Multiprocessor + Abyss + PHP = poor performance

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
mobrien
-


Joined: 05 Oct 2004
Posts: 18

PostPosted: Mon Feb 12, 2007 4:17 pm    Post subject: Multiprocessor + Abyss + PHP = poor performance Reply with quote

Hi,

I am running abyss on a Windows machine with a p4 HT processor. I noticed that scripts seem to run faster on my pIII linux machine, but I can't use it.

Upon further inspection, I noticed that multiple PHP threads were opening when a complex page is loaded. This is good. However, all of the php functions are run on the same virtual processor. I'm sure that performance would be much better if they used both processors. It would be even better if PHP would use both processors at the thread level (use both for each process).

Does anyone know if there is a way to force it to alternate threads between processors? Is this a function of PHP or Abyss Web Server?

Thanks for your help,

--mobrien
_________________
---------------------------------------------------------
http://mobrien118.sytes.net
Back to top View user's profile Send private message Visit poster's website
Tom Chapman
-


Joined: 09 Jul 2005
Posts: 933
Location: Australia

PostPosted: Mon Feb 12, 2007 10:08 pm    Post subject: Reply with quote

ht gives you a virtual processor?
Back to top View user's profile Send private message Visit poster's website MSN Messenger
olly86
-


Joined: 25 Apr 2003
Posts: 993
Location: Wiltshire, UK

PostPosted: Mon Feb 12, 2007 10:21 pm    Post subject: Reply with quote

The OS is responsible for controlling where the process are run, and how long there time slot is, etc. I don't think Abyss or PHP has the power to alter this. A Pentium 4 processor is a signal core chip only, and as a result cannot run more than one thread at a time. To decrees script execution time, try reducing the number of other applications / processes running on the computer.
_________________
Olly
Back to top View user's profile Send private message
mobrien
-


Joined: 05 Oct 2004
Posts: 18

PostPosted: Mon Feb 12, 2007 10:22 pm    Post subject: Reply with quote

Tom Chapman wrote:
ht gives you a virtual processor?


Well, HyperThreading technically is 2 virtual processors. The processor looks like 2, but there is really only 1 CPU. That is how it achieves performance gains, by using two instruction queues and organizing computations to maximize processor efficiency without actually adding another CPU (like todays dual core processors do). Check out wikipedia or intel's website for more information on the topic.

The problem MAY be with my system, but php-cgi.exe will only use 50% max of my total processor utilization (viewable through task manager).

--mobrien
_________________
---------------------------------------------------------
http://mobrien118.sytes.net
Back to top View user's profile Send private message Visit poster's website
Tom Chapman
-


Joined: 09 Jul 2005
Posts: 933
Location: Australia

PostPosted: Tue Feb 13, 2007 7:05 am    Post subject: Reply with quote

hyper-threading why not call it dt (dual-threading)?
Back to top View user's profile Send private message Visit poster's website MSN Messenger
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Tue Feb 13, 2007 11:17 am    Post subject: Re: Multiprocessor + Abyss + PHP = poor performance Reply with quote

mobrien,

It's the operating system that handles process/thread scheduling and no user application has the power to interfere with its decisions.

For your information PHP does not use multithreading. It's basically one process using one thread (even if you can see two or three threads, only one is relevant for the PHP code execution).

So when you use FastCGI, and have two or more PHP processes handling concurrent PHP requests, chances are that the OS will run each PHP process on a different (virtual) processor.

By the way, you should also check the other processes that are running on your computer at the same time: poor performance on modern hardware is often a sign of a resource sucker (such as an antivirus) running on your computer.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
mobrien
-


Joined: 05 Oct 2004
Posts: 18

PostPosted: Tue Feb 13, 2007 6:02 pm    Post subject: Re: Multiprocessor + Abyss + PHP = poor performance Reply with quote

aprelium wrote:
mobrien,

It's the operating system that handles process/thread scheduling and no user application has the power to interfere with its decisions.

For your information PHP does not use multithreading. It's basically one process using one thread (even if you can see two or three threads, only one is relevant for the PHP code execution).

So when you use FastCGI, and have two or more PHP processes handling concurrent PHP requests, chances are that the OS will run each PHP process on a different (virtual) processor.

By the way, you should also check the other processes that are running on your computer at the same time: poor performance on modern hardware is often a sign of a resource sucker (such as an antivirus) running on your computer.


I use ProcessExplorer to view process information, and when I load a complex page with many php includes, it opens many processes. For instance, I have Gallery2 on my web server. When I load the main page it starts 4 php processes with abyss as the parent process. The thing is that the php processes will max out at 50% processor usage, and they ALL run on the same HT virtual processor. I was just hoping that there was some way to make them use both. Maybe it is an OS problem, but it's not a resource hog problem (to any significant degree).

I think I am going to invest in a multicore machine pretty soon anyway. I am using Server 2003, if that makes any difference.

Thanks for the info!

--mobrien
_________________
---------------------------------------------------------
http://mobrien118.sytes.net
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed Feb 14, 2007 1:46 pm    Post subject: Re: Multiprocessor + Abyss + PHP = poor performance Reply with quote

mobrien,

The 50% CPU load restriction has to do with the HT technology of your Pentium 4. You can read similar complaints regarding other software in http://www.xtremesystems.org/forums/archive/index.php/t-96978.html and http://forum.doom9.org/archive/index.php/t-72184.html (2 examples only, but you can find more). To make a long story short, it seems that a single thread on HT cannot use more than 50% of the processor ressources.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Wed Feb 14, 2007 1:49 pm    Post subject: Reply with quote

Because of the 50% usage issue you may find it better to disable HT in the BIOS of your motherboard. This may increase performance, but then it could also decrease performance of other programs.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
Immemiaplaype
-


Joined: 13 Jul 2011
Posts: 13
Location: United Kingdom

PostPosted: Mon Dec 19, 2011 12:57 pm    Post subject: Multiprocessor Abyss PHP poor performance Reply with quote

The Devs could use the information

A good way to get your system specs is to to go the start menu, hit run, and type dxdiag in the box.

The only thing I request before you post your specs is to

PLEASE UPDATE YOUR DRIVERS This will help your performance.
Back to top View user's profile Send private message Send e-mail ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group