[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

php cgi resources

Posted on 2011-04-29
37
Medium Priority
?
421 Views
Last Modified: 2013-12-13
Using PHP 5.3.6 windows server 2008. If PHP.cgi.exe caused the server to freeze for 10 seconds where applications stop working.  What would I look for in event log.  Could this problem be solved by installing an older version PHP.  Is. Php 5.3.6 more resource intensive.
0
Comment
Question by:rgb192
  • 18
  • 8
  • 6
  • +2
36 Comments
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 752 total points
ID: 35496345
0
 
LVL 27

Assisted Solution

by:skullnobrains
skullnobrains earned 252 total points
ID: 35497290
sorry this is not really your answer

php.cgi is inefficient by design as any cgi
IIS is messy enough to freeze the whole machine because one single thread is blocked

i'd advice you use production-ready software
on windows, i guess lighttpd for windows + php fastcgi (spawned by lighttpd itself for ease of use) is a reasonnable choice. apache with mod_php as well (the graphical php installer configures the module for you), or perhaps more unusual sambar server, or the php web server itself (i think mono is the name)

then your answer is

do not loose your time. it is highly unlikely that you will find any usefull information in the windows log regarding that kind of problems, but the application log is the place to search. for efficient searching sysinternals provide a nice free log dumper and unix tools for windows or cygwin should give you a grep command
0
 

Author Comment

by:rgb192
ID: 35498460
How to install what skullnobrains suggested on iis 7 windows server 2008
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
LVL 51

Assisted Solution

by:Steve Bink
Steve Bink earned 500 total points
ID: 35510132
IIS7 with PHP/FastCGI performs very well.  We use it on just about every public-facing server at my datacenter.  You do not need to go through the trouble of replacing your web service platform to address this issue.  DaveBaldwin's suggestion should your first choice.

http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-7/
http://php.iis.net/
0
 

Author Comment

by:rgb192
ID: 35514373
I did that and am getting server latency.  I like skullnobrains idea
0
 

Author Comment

by:rgb192
ID: 35574048
Does skullnobrains idea mean not using iis
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 35630609
Yes, it does.  "lighttpd" is a different web server.
0
 

Author Comment

by:rgb192
ID: 35692325
from

http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-7/ 


and skullnobrains using the word 'thread'


It is recommended that you use a non-thread safe build of PHP with IIS 7 FastCGI. A non-thread safe build of PHP provides significant performance gains over the standard build by not doing any thread-safety checks, which are not necessary, since FastCGI ensures a single threaded execution environment.

how can I tell if my php is 'non-thread safe'
could this be my error
0
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 752 total points
ID: 35692565
Here's the Microsoft page http://www.microsoft.com/web/platform/phponwindows.aspx and it has a link to the Windows PHP pages where the versions are listed as thread and non-thread safe.  http://windows.php.net/download/  You can also look for "Thread Safety" in the first section the "phpinfo()" page.
0
 

Author Comment

by:rgb192
ID: 35693056
my version of php (from phpinfo() )
Thread Safety       disabled


before I reinstall php, do you think that this is my error
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 35693622
No, that means it is a "non-thread safe" version.  That is the one recommended for FastCGI.

What do you mean by "server latency"?
0
 

Author Comment

by:rgb192
ID: 35694106
So what else could this error be
0
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 752 total points
ID: 35694360
It could be a lot of things including the code on the pages.  Did you install FastCGI from the Microsoft page?  How are you determining that the server is 'freezing' for 10 seconds?
0
 

Author Comment

by:rgb192
ID: 35695151
freezing for 10 seconds:
i can type text, but I wont see it for 10 seconds

this happens once a minute


I am not sure if I installed fastcgi or cgi   (how to tell)

I followed the advice of 2 links of which I dont remember.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 35695259
What program are you running, what are you doing, and are you doing on the server machine and not on a workstation?
0
 

Author Comment

by:rgb192
ID: 35695300
i am running websites that use php 5.3  (but I can use any php to eliminate these errors) and sql server 2005
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 35695360
I understand that but I'm trying to figure what you are running when you see these errors and where you are running it.  If you are using your browser on Facebook, for example, it is common for your page to 'lockup' while the javascript gets a new batch of data for your page.  That is a stall but it is not an error.  Not everything that causes a stall is an error.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 35695366
Details are important.  Just saying that you get a 10 second stall isn't anywhere near enough detail for troubleshooting.
0
 

Author Comment

by:rgb192
ID: 35695420
the 10 seconds stalls occur on all programs on windows, not just one website on one browser


and when I press alt tab to toggle through programs

nothing happens until 10seconds later
0
 
LVL 51

Expert Comment

by:Steve Bink
ID: 35695789
And how are delays when pressing alt-tab are related to your server?
0
 

Author Comment

by:rgb192
ID: 35698865
I have programs installed on server and press alt tab to toggle.  But if server is frozen, nothing happens for 10seconds
0
 
LVL 4

Assisted Solution

by:contactrobol
contactrobol earned 496 total points
ID: 35702854
check your disk IO . Enable error log and slow log in php.ini . Php works perfect on windows env if setup properly. Setup raid on the server.

Place this in php.ini
display_errors = Off
log_errors = On
error_log = "error.log"

Open in new window


Setup more process
Check servers event log and see what is causing . I strongly recommend using a raid setup on your server.
I have been using php on production env setup on windows server handling more then 100000 users per day.

0
 
LVL 51

Assisted Solution

by:Steve Bink
Steve Bink earned 500 total points
ID: 35705090
>>>  But if server is frozen, nothing happens for 10seconds

That certainly does not sound like something limited to the web service.  It sounds like you are having issues with disk IO, as suggested by contactrobol.  Start watching your performance monitor metrics.
0
 

Author Comment

by:rgb192
ID: 35710927
Nothing is written in event log when the freeze happens
0
 
LVL 4

Expert Comment

by:contactrobol
ID: 35710930
perform a full hardware test. if server hosted at a dc ask them to perform full hardware test. possible suspect may be memory leak.
0
 

Author Comment

by:rgb192
ID: 35722981
when I change
c:/php
to
c:/phpbackup

disabling php

the freezing goes away
0
 

Author Comment

by:rgb192
ID: 35722994
when I change
c:/php
to
c:/phpbackup

disabling php

the freezing goes away

I dont make any other changes, all I do is rename the folder
0
 
LVL 4

Expert Comment

by:contactrobol
ID: 35724265
That means something in php is causing it. perform a fresh installation of latest thread safe php. And if it still happens that means there is something wrong in your website code. to find out whats wrong. If the php based website connects to a mysql db or perform any sort of data upload to the server. You can trace with

> slow query log in mysql
> Check permissions on the php folder make sure the iis user has read and write permission .
There is nutting that is not logged. If you know how to check logs properly. You can figure out whats causing .
0
 

Author Comment

by:rgb192
ID: 35742691
formally using php5.3.6

i peformed a fresh installation of
php5.2.17

and still have the same problem

however when I disable php by renaming c:\php to something else, the problem does not exist

0
 
LVL 4

Expert Comment

by:contactrobol
ID: 35743086
whats your server config ?
0
 

Author Comment

by:rgb192
ID: 35743848
I think my server config is windows server 2008 r2.  Iis7 fastcgi PHP 5.2.17
0
 
LVL 4

Expert Comment

by:contactrobol
ID: 35744015
what about hardware. processor and ram and hdd
0
 

Author Comment

by:rgb192
ID: 35747344
Windows Server 2008 R2 Standard Service Pack1.
Processor: Intel(R) Xeon(R) CPU L5609 @ 1.87GHz 1.86 GHz
installed memory (ram) 8.00GB
64 bit operating system

I am using a semi dedicated hosting virtual machine
0
 
LVL 4

Assisted Solution

by:contactrobol
contactrobol earned 496 total points
ID: 35750286
semi dedicated hosting virtual machine move to a dedicated server or a cloud based server.
0
 

Author Comment

by:rgb192
ID: 35752346
If I am using semi dedicated hosting on a virtual machine, could other hosting customers be using my resources.
0
 

Author Closing Comment

by:rgb192
ID: 35761591
thank you all.
sorry it took me so long to decide
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month18 days, 23 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question