High CPU when Loading SCORM (in the deep end)

High CPU when Loading SCORM (in the deep end)

by Simon Harbinson -
Number of replies: 8

Hi Sorry to do this but its yet another I done have a clue post.  I have been chucked in at the deep end and have been asked to investigate high CPU with our new Moodle server, needless to say I'm more a PC and MAC engineer but have had little contact with Apache, PHP & MySQL.


Server Spec:

Virtual server using VMware 5.5.0 Update 3

OS Windows server 2012 R2 

4GB RAM

4 Virtual Core CPUs

Apache 2.4.12 (32Bit)

PHP 5.6.7  (x86)

MySQL 5.6


Anytime we run a SCORM package, the CPU on the server jumps to about 80% this is with only one user with 4 or more the CPU is being hammered so much we get a alert from the SCORM package "the SCORM player has determined that your Internet connection is unreliable...." and so on.


Looking at the server the RAM (about 50% in use with one user)and Disk I/O seem fine but the CPU is getting hammered by the httpd.exe process. the process does not error out we just get high CPU while the SCORM package is loaded then drops back to 5%-8%.

I have increased the VCPUs to 4 as originally it only had one.

I have had the VMWare tools updated

I'm arranging to have the page file set static instead of dynamic.

I have read lot of posts about PHP needing an accelerator but if I'm using Apache do I need one?


so before I go ahead with a long winded process log for httpd.exe that may or may not help, has anyone has this or similar issue and how was it resolved also if anyone could give me any pointer.


If I have missed any required information please let me know.


Thanks Simon

Average of ratings: -
In reply to Simon Harbinson

Re: High CPU when Loading SCORM (in the deep end)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Moving to Hardware and Performance...

In reply to Simon Harbinson

Re: High CPU when Loading SCORM (in the deep end)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Avoiding the obvious, "If you'd used Linux you'd have been fine"...  

Basics:

- have you run the performance report in your Moodle site?
- Have you read https://docs.moodle.org/30/en/Performance_recommendations?
- Is your MUC set up properly https://docs.moodle.org/30/en/Caching, especially if you have poor Disk IO performance (which many VMs do)?

If you're running PHP 5.6.7 then you have an accelerator built in. Make sure it's enabled - see https://docs.moodle.org/30/en/OPcache

Is loading a SCORM the *only* time you see issues?

Average of ratings: Useful (2)
In reply to Howard Miller

Re: High CPU when Loading SCORM (in the deep end)

by Simon Harbinson -

Hi Howard, thanks for the response and I'm going sound like a right noob, I was thinking that about Linux as it seem to be the most used OS, Lets call that Plan F for Simon Failed to get it to work smile  also I dodo not build the server it was built by the web team who have known Linux experience.

performance report - Not yet did not know thee was one.

Have I read https;//... - Yes still working my way through it.

Is your MUC setup - don't know will have to read the page.

Accelorator - do you mean "opcache.max_accelerated_files = 8000" it was at 4000

Yes the High CPU is only while the SCORM activity is loading, once finished or if you close the popup the CPU drops

I have enabled a PHP info page that can accessed not sure if that is secure but for now if it helps.


UPDATE Performance report added, Debugging message I turn back to Warn this morning 



Simon


Attachment Perfreport.PNG
In reply to Simon Harbinson

Re: High CPU when Loading SCORM (in the deep end)

by Usman Asar -
Picture of Plugin developers Picture of Testers

Simon, I mustn't say it's your disk throughput for you're already on hyper-visor being vSphere rather than VMWare workstation adding in a layer of O/S in between, but then again could be your disk I/O's if it's one disk configuration.

Secondly, Apache on Windows does not perform as well, as it performs on Linux, if you're setting up moodle on Windows Environment, then it will make more sense setting it up on IIS rather than Apache.

Now regarding max_accelerated files, that figure of 8000 is only required if you're using Moodle 3.0 or higher, else for older versions setting of 4000 is fine. Have you checked DB buffer size as well? also, is it independent setup of services (Web server, PHP and DB) or is it that you're using XAMPP or Moodle's windows installer package?

Just for your info, Apache is  web server and have nothing to do with PHP acceleration, for that you have to use APC, Varnish, OpCache (recommended). I had recently posted blog setting up Moodle on Server 2012 using IIS, if it may interest you to setup IIS, then you can view tutorial HERE.


Average of ratings: Useful (2)
In reply to Simon Harbinson

Re: High CPU when Loading SCORM (in the deep end)

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

There are two approaches to your problem. First one: take the platform (hardware and all the system software) as given and to find out the one (other) piece which broke the system, then change it. Second one: Question the whole platform, find out the broken system software (combination) and change it.

As others have pointed out, your web team hasn't hit the luckiest choice. (Likely) A Windows server running VMware, and another Windows server running on top of it! For one - VMware is desktop virtualization - if Windows they should have taken either vSphere or HyperV! (Well, I am not sure what VMware product you meant. They enjoy changing the names of their products every season. ;) Second thing, Once you have a reasonable virtualization system you don't sink it with Windows! (Well, a bit of bias here. ;)

Still I would give a try to the first approach: It is cheaper and also the detective work could be exciting. Rebuilding the server is cheap for an engineer.
;)

How to start that journey is (was) documented in the header of this forum. You can revisit, only when you start a new discussion. You can simulate that by clicking the button "Add a new discussion topic", direct link https://moodle.org/mod/forum/post.php?forum=94.

Then there is another factor: SCORM. I am not familiar with SCORM but remember seeing performance problems in the SCORM forum. You should do some reading with the help of the "Advanced search" mentioned in the header of this forum.
In reply to Howard Miller

Re: High CPU when Loading SCORM (in the deep end)

by Simon Harbinson -

Just an update,

I fixed the issue with option F and rebuilt the box with a Linux OS and it running a lot better, still have some questions that I looking at today and raising questions if I cannot find an answer.

So for any one suffering with similar issue, host Moodle on a Linux box the documentation here is very well written, don't be scared it's only Linux.


Average of ratings: Useful (1)
In reply to Simon Harbinson

Re: High CPU when Loading SCORM (in the deep end)

by Sam Stevens -

Very similar to my setup. (Yes I know but I'm forced into windows as well)

Things to check:

Add PHP to PATH http://php.net/manual/en/faq.installation.php#faq.installation.addtopath 

PHP accelerator. I think on by default in that version but check php info.

Check any windows virus checkers or similar. Which might be interfering with the zip file

Potentially don't use scorm zips as it might be that it is having trouble with the zip.