Sunday, January 15, 2017

index_cpu.cgi causing 100% CPU spikes using Authentic Theme #410

https://github.com/qooob/authentic-theme/issues/410

Hi,
I think I have found a bug when using the Authentic Theme. Periodically when using the theme /usr/share/webmin/proc/index_cpu.cgi spikes to 100% CPU usage for about 5 - 10 minutes. I have been doing a bit of tracing and initially thought it was down to MySQL but under the processes tab of Virtualmin I found this to be the cause.
For now I have switched back to the Virtualmin Framed Theme and will monitor if this is indeed the cause. I am running a VPS on Digitalocean:
Ubuntu 14.04 LTS
1GB RAM
30GB SSD
2GB Swap
Anyone else had this issue?
Cheers
Dylan
@qooob
Owner
qooob commented on Feb 28, 2016
I have never experienced this issue and I truly doubt that it has anything to do with the theme.
@dylanrhysscott
Swapping back to Virtualmin Framed Theme has pushed this value down to 3% CPU usage I have been monitoring it for the last few hours. This person here also has had a similar issue when running the theme -http://www.webhostingtalk.com/showthread.php?t=1530070
@qooob
Owner
qooob commented on Feb 28, 2016
I understand. Every 5 minutes (300 sec), System Status, scheduled_collect_system_info also happens in Webmin Configuration->Webmin Scheduled functions.
It's not a bug. I have found out on my server (64gb RAM, SSD, and 12x2 CPU Cores), that index_cpu.cgigoes upto 4-5%. In case I switch to VM Framed Theme then it drops down to 0.4-0.5%. Well, it's true that Authentic Theme is more resourceful. When you reload index_cpu.cgi page it makes the whole theme load from the beginning and thus it uses a lot of CPU power. In case of not very powerful machine it will be 100%. In reality the load will not be there as long as you don't reload the page.
Thank you for reporting but it's not a bug. Theme does a lot of calculations and stuff upon load. I don't think I can help it. But overtime, that is for sure, I will try my best to do more and more optimizations, in case it's technically possible, to make theme shine in every possible way.
@qooob qooob closed this on Feb 28, 2016
@dylanrhysscott
Hi,
Thanks for your in depth answer it's most helpful. In some cases when I was on Virtualmin and SSHing into the VPS the SSH would suffer (i.e take longer to connect) . Its a fantastic theme and I love the look it gives but does raise some concerns when it max outs the CPU. Its true in the case of my low power VPS the CPU takes a hit. - If you need any more info from me drop me a line but great work and keep it up! Probably just needs some tweaking :)
@qooob
Owner
qooob commented on Feb 28, 2016
Thank you for your kind words and you are welcome.
I totally agree with you, that there is some room for code optimisation. Please understand, that making usable, optimised and great build (architect wise code) is a very very difficult task.
VPS is very specific. I remember, before having separate server, I couldn't even reload a page (http), when ffmpeg was running.
There should be a possibly on limiting CPU/RAM usage, this could be a solution.
Before I got a server of my own, I used to use ServInt - it was very good for me and I reccomend trying it.
@dylanrhysscott
Thanks for the recommend - Will take a look! Yeah I agree writing well optimized code is a daunting task. I come from a web development background and am constantly looking for ways to refactor it. Nothing on the same league as VM but still. Do you prefer dedicated over VPS then?
@qooob
Owner
qooob commented on Feb 28, 2016
Yes, I do.
Dedicated will provide much much better experience. However, it's all based on your tasks.