It was months I was noticing my Dell laptop [Ubuntu 16.04] becoming suddenly slower, now I tracked down it happens when I unplug it from its own docking station. It doesn't seems to be related to power socks or no internet, as I have the same problem e.g. when I work from the train with the laptop connected to the sock.. it's just when it is out of its docking station.. See the following console session where I benchmark a dummy function using Julia (the problem is not in Julia.. I have problems also in compiling big pdf from LaTeX on any other computationally-intensive problem). There seems not to be any problem in other processes eating CPU or memory.
$ julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.5.1 (2017-03-05 13:25 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-pc-linux-gnu
julia> function f(n)
s = 0
for i = 1:n
s += i/2
end
s
end
f (generic function with 1 method)
julia> @time f(100000000)
1.948031 seconds (300.00 M allocations: 4.470 GB, 14.57% gc time)
2.500000025e15
julia> @time f(100000000)
1.771005 seconds (300.00 M allocations: 4.470 GB, 7.27% gc time)
2.500000025e15
julia> @time f(100000000)
1.764294 seconds (300.00 M allocations: 4.470 GB, 7.00% gc time)
2.500000025e15
julia> @time f(100000000)
1.776455 seconds (300.00 M allocations: 4.470 GB, 7.06% gc time)
2.500000025e15
julia> @time f(100000000)
1.791494 seconds (300.00 M allocations: 4.470 GB, 7.12% gc time)
2.500000025e15
julia> @time f(100000000) # here I unplug the laptop from the docking station
11.927460 seconds (300.00 M allocations: 4.470 GB, 5.56% gc time)
2.500000025e15
julia> @time f(100000000)
12.201062 seconds (300.00 M allocations: 4.470 GB, 5.50% gc time)
2.500000025e15
julia> @time f(100000000) # here I plugged the power cord directly to the laptop
11.839180 seconds (300.00 M allocations: 4.470 GB, 5.62% gc time)
2.500000025e15
julia> @time f(100000000) # here I removed internet conection, including wifi
11.860953 seconds (300.00 M allocations: 4.470 GB, 5.65% gc time)
2.500000025e15
julia> @time f(100000000) # here I plugged back the laptop on the deck
11.789184 seconds (300.00 M allocations: 4.470 GB, 5.63% gc time)
2.500000025e15
julia> @time f(100000000) # here I switched the keyboqrd to English lqnguqge
11.857721 seconds (300.00 M allocations: 4.470 GB, 5.68% gc time)
2.500000025e15
julia> @time f(100000000) # here I closed the screen of the laptop and worked back on the main screen
12.001792 seconds (300.00 M allocations: 4.470 GB, 5.63% gc time)
2.500000025e15
julia> @time f(100000000) # here I am back to ethernet
11.865361 seconds (300.00 M allocations: 4.470 GB, 5.71% gc time)
2.500000025e15
julia> exit()
$ julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.5.1 (2017-03-05 13:25 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-pc-linux-gnu
julia> @time f(100000000) # here I went off and on Julia
ERROR: UndefVarError: f not defined
julia> function f(n)
s = 0
for i = 1:n
s += i/2
end
s
end
f (generic function with 1 method)
julia> @time f(100000000) # here I went off and on Julia
12.809319 seconds (300.00 M allocations: 4.470 GB, 11.16% gc time)
2.500000025e15
julia> @time f(100000000) # here after lot of time (lunch break)
11.916337 seconds (300.00 M allocations: 4.470 GB, 5.49% gc time)
2.500000025e15
julia> quit()
$ julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.5.1 (2017-03-05 13:25 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-pc-linux-gnu
julia> @time f(100000000) # here after suspended the pc and julia stop/restart
ERROR: UndefVarError: f not defined
julia> function f(n)
s = 0
for i = 1:n
s += i/2
end
s
end
f (generic function with 1 method)
julia> @time f(100000000) # here after suspended the pc and julia stop/restart
1.952593 seconds (300.00 M allocations: 4.470 GB, 14.26% gc time)
2.500000025e15
julia> @time f(100000000) # here after suspended the pc and julia stop/restart
1.824997 seconds (300.00 M allocations: 4.470 GB, 6.34% gc time)
2.500000025e15
julia>
EDITED: The following transcript show something interesting.. in the previous unplug from the docking station I did it with the screen closed, now I unplug it with the screen on and in this way it works.. until I do remove the power plug and do a suspend/resume.. then it does not work, then I plug the power, do a suspend/resume and it works well again... It seems it goes in low-consumption mode and it doesn't matter if you plug back the power, you need to also give the laptop a suspend/resume in order for the laptop to realise it is plugged back...
quit()
lobianco@lobianco-officeLinux:~/Dropbox/Documenti/Varie/lef/papers/ffsm++/versions/07_carbon_balance_with_multipliers$ julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.5.1 (2017-03-05 13:25 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-pc-linux-gnu
julia> function f(n)
s = 0
for i = 1:n
s += i/2
end
s
end
f (generic function with 1 method)
julia> @time f(100000000) # after switched off internet and moved back to french
1.939228 seconds (300.00 M allocations: 4.470 GB, 13.96% gc time)
2.500000025e15
julia> @time f(100000000) # after switched off internet and moved back to french
1.761612 seconds (300.00 M allocations: 4.470 GB, 6.42% gc time)
2.500000025e15
julia> @time f(100000000) # after unplugged power but still laptop on his own deck
1.775432 seconds (300.00 M allocations: 4.470 GB, 6.30% gc time)
2.500000025e15
julia> @time f(100000000) # after removing laptop from the deck (still unplugged)
1.770068 seconds (300.00 M allocations: 4.470 GB, 6.28% gc time)
2.500000025e15
julia> @time f(100000000) # after removing laptop from the deck (still unplugged)
1.744716 seconds (300.00 M allocations: 4.470 GB, 6.32% gc time)
2.500000025e15
julia> @time f(100000000) # after suspend/resume
11.743261 seconds (300.00 M allocations: 4.470 GB, 5.28% gc time)
2.500000025e15
julia> @time f(100000000) # after plugging the power (still disconnected from deck)
11.722175 seconds (300.00 M allocations: 4.470 GB, 5.30% gc time)
2.500000025e15
julia> @time f(100000000) # after suspend/resume
1.770605 seconds (300.00 M allocations: 4.470 GB, 6.29% gc time)
2.500000025e15
julia>
I can finally state that it is related to the fact of being unplugged to the power socket. The laptop switch to low-energy conservation mode, but it realises any change only when it is suspended/resumed.
So, if for example the laptop in on his own docking station, the plug is connected to the docking station and the screen lid is closed (as I work with external screen/keyboard) and then I remove the laptop, put it on, and switch the cable from the docking station to the laptop (that's my default behaviour), the laptop will continue to operate in low-energy mode as it would has no power plug. I need to then suspend/resume the laptop in order to make it realises that it is connected back (or, alternatively, move the plug from the docking station to the laptop before removing the laptop from the docking station).
In all cases, I believe it is a ubuntu bug, as the laptop should realise in real-time if it is connected to the socket or not, and not just when it is suspended/resumed..