[EMAIL PROTECTED] How is PHP script executed in apache

2007-05-10 Thread Chidanand Gangur

Hi,

I have compiled PHP as module in apache. Recently I have noticed a strange
problem when apache executes the PHP script.

My assumption till date:

1. If there are number of request destined to the same/different PHP page
then apache will spwan child process to handle the load.
2. If two requests are sent simultaneously on same page then apache module
will process those two requests parallely with two different child threads.

Am I right on my assumptions?

1. In my test I have x.php which talks to a backend modules
2. I send some request to x.php which inturn lands on the backend module(1)
through sockets.
3. Mean while when backend module(1) is busy in processing, another request
arrives on the x.php.
4. This request  is destined to backend module (2)

My observation here is the response from the backend module( 2) is blocked
till the response from backend module( 1) is completed.
whereas as per my assumption apache shoud have processed these two requests
in two different threads/child process without blocking.

Is this expected behaviour? what should I do to get parallelism.
I would like to know more about how the php scripts are processed in apache,
can some one guid me to a useful link.

--
Thanks,
Chidanand Gangur
Pune.


[EMAIL PROTECTED] unable to read raw data from ssl enabled server

2005-10-24 Thread Chidanand Gangur
Hi all,I have a sceneraio as shown in the diagram below.++ xml  +---+|unix
sock|<->|unix
sock   ||  
PHP|
|   Back End||  |<-+|Module  
|++  
||
||
|   
|++
+-+|Apache
Server|||  MSIE
6  ||  1.3.29
|+-->|  Browser
|||  xml
over
ssl  
|  playing flash+-+  
|  application |  
+--+I have apache 1.3.29 compiled with
modssl and PHP. I have a flash screen which sends XML data to the back
end module via PHP script. To achieve this I read the HTTP raw data in
php script open unix socket connection
to my back end module and send the XML for further processing . When
PHP gets the response from the back end module I send it to flash and immediately close the socket connection to my backend module. This
the point where I have the problem , when i send the data to flash
appln running in the browser i see that the falsh havent received any
thing it says 0 bytes received. I tried to look in to SSL_request and engine logs where i get [debug] OpenSSL: I/O error 23 bytes expected to write on BIO[debug] OpenSSL: I/O error 23 bytes expected to write on BIO
[debug] OpenSSL: I/O error 23 bytes expected to write on BIO[info] connection to child closed with standard shutdown on further googling I found 
http://www.modssl.org/docs/2.8/ssl_faq.html#ToC49

I did the approriate settings in my httpd.conf as suggested on the link given above but that too didnt help.
SetEnvIf User-Agent ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0
One thing to confirm is, there is nothing wrong in flash appln since it works very well on http with IE and with http/https on 
 fire fox browser, hence I am suspecting this as some server side
configuration issue. Can some one help me to solve this problem?

I would like to add one more point
On IE  https works fine that is the flash files on server gets
loaded properly or if i have some static html page that too works fine.
I see the above problem only when i have some PHP to back end communication.

Thanks,
Chidanand GangurPune. 


[EMAIL PROTECTED] SSL and MSIE not working properly.

2005-11-03 Thread Chidanand Gangur
Hi all,

I have a sceneraio as shown in the diagram below.

++ xml  +---+
|unix
sock|<->|unix
sock   |
|  
PHP|  
  
|   Back End||  |<-+|Module  
|++  
||
||
|   
|++
+-+|Apache
Server|||  MSIE
6  ||  1.3.29
|+-->|  Browser
|||  xml
over
ssl  
|  playing flash+-+  
|  application |  
+--+I have apache 1.3.29 compiled with
modssl and PHP. I have a flash screen which sends XML data to the back
end module via PHP script. To achieve this I read the HTTP raw data in
php script open unix socket connection
to my back end module and send the XML for further processing . When
PHP gets the response from the back end module I send it to flash and immediately close the socket connection to my backend module. This
the point where I have the problem , when i send the data to flash
appln running in the browser i see that the falsh havent received any
thing it says 0 bytes received. I tried to look in to SSL_request and engine logs where i get [debug] OpenSSL: I/O error 23 bytes expected to write on BIO[debug] OpenSSL: I/O error 23 bytes expected to write on BIO
[debug] OpenSSL: I/O error 23 bytes expected to write on BIO[info] connection to child closed with standard shutdown on further googling I found 

http://www.modssl.org/docs/2.8/ssl_faq.html#ToC49

I did the approriate settings in my httpd.conf as suggested on the link given above but that too didnt help.
SetEnvIf User-Agent ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0
One thing to confirm is, there is nothing wrong in flash appln since it works very well on http with IE and with http/https on 
 fire fox browser, hence I am suspecting this as some server side
configuration issue. Can some one help me to solve this problem?

I would like to add one more point
On IE  https works fine that is the flash files on server gets
loaded properly or if i have some static html page that too works fine.
I see the above problem only when i have some PHP to back end communication.

Thanks,
Chidanand GangurPune.
-- Chidanand GangurPune.


[EMAIL PROTECTED] Apache restarts on logrotate

2006-08-25 Thread Chidanand Gangur

Hi all,

I have configured apache with php and ssl. I have statically linked
them in apache and using it for an embedded application. I have also
configured logrotate to rotate the log files when the
access_log/error_log reaches to 5M.

I am using apache-1.3.34.
 
Many times I see the following message in my error_log file.

[notice] SIGHUP received.  Attempting to restart

after googling I found that SIGHUP is sent by logrotate when it clears and backups the file.

I see this event every often. 

Does the process actually get restarted,  or is reloaded?

Some times I see that apache process hangs with limit of MaxClient
reached. This condition sometime recovers over the period of time and
some time does not.

Is that the frequent restart of apache process causing this problem? 

When the condition arises I also tried to do netstat I see lot of
stream sockets in connected state. UNIX stream sockets are openened in
PHP script to talk to othe r modules in the system.

unix  2  [
]
STREAM CONNECTED
8657659 22202/httpd 
unix  2  [
]
STREAM CONNECTED
8657655
9190/httpd  
unix  2  [
]
STREAM CONNECTED
8657654 22231/httpd 
unix  2  [
]
STREAM CONNECTED
8657653
669/httpd   
unix  2  [
]
STREAM CONNECTED
8657643
7228/httpd  
unix  2  [
]
STREAM CONNECTED
8657642 28418/httpd 
unix  2  [
]
STREAM CONNECTED
8657640
412/httpd   
unix  2  [
]
STREAM CONNECTED
8657637 32393/httpd 
unix  2  [
]
STREAM CONNECTED
8657636 25979/httpd 
unix  2  [
]
STREAM CONNECTED
8657635 19223/httpd 
unix  2  [
]
STREAM CONNECTED
8657634 17688/httpd 
unix  2  [
]
STREAM CONNECTED
8657628
5491/httpd  
unix  2  [
]
STREAM CONNECTED
8657623 10928/httpd 
unix  2  [
]
STREAM CONNECTED
8657622 30138/httpd 
unix  2  [
]
STREAM CONNECTED
8657620
514/httpd   
unix  2  [
]
STREAM CONNECTED
8657618 16177/httpd 
unix  2  [
]
STREAM CONNECTED
8657613 25896/httpd 

-- Chidanand GangurPune.


[EMAIL PROTECTED] Apache stops processing the request

2006-08-29 Thread Chidanand Gangur

Hi,

I am using apache with mod_php and mod_ssl

apache-1.3.34
php-4.4.2


I have following server configuration

  Timeout   300
  MaxKeepAliveRequests  0
  KeepAliveTimeout  60
  KeepAlive On
  MinSpareServers   3
  MaxSpareServers   5
  StartServers  4
  MaxClients    250
  MaxRequestsPerChild   0

Let me explain my system


--  UNIX stream socket   
-    SSL
 
-
backend  
<-->Apache server   
<--->client (around 150-180)
module
--  
- 
-- 

Few client querys for some data (the data length can vary from 10-100K)
from the back end every 30 seconds this communication from php to
backend process happens on unix stream socket.
 
Rest of the clients keep on sending periodic keep alives to the backend
every 60 seconds. (communication for these request to back end happens
on UNIX datagram sockets. 

All the comunication from client to Apache is on SSL.

My observation:

Too many apache process get spwaned (100-150) and things become very slow. 

1.  where my apache process stops responding
to the client requests.
2.  When this problem occurs I see
lot of unix stream sockets in the netstat. 
3.  free memory on my system (180-200Mb). 
4.  Number of apache process (150-180)
5.  when issused ps -ax i see al the process show status as S (sleeping)
6.  I see lot of UNIX stream socket entries in netstat
7.  I see the data is not sent from php to the back end module.
8.  All of a sudden burst of request come to the back end. (Burst requests are served properly by the back end)

So my question is when I have MaxClients as 250 why are the request not served.
What server configuration is going wrong?
Is there any internal limitation which is causing such condition?
Does apache+mod_php+mod_ssl have any limitation?

Please give a pointer to go ahead. 
-- Chidanand GangurPune.


[EMAIL PROTECTED] Scoreboard file not created

2006-08-30 Thread Chidanand Gangur
Hi,

I have compiled apache 1.3.34 on linux 2.4.28 the compilation went
through fine and no issues in normal working of apache. I want to
enable scoreboard feature of apache, I have added the corresponding
configuration line in httpd.conf but still the contfiguration file but
still i do not find the scoreboard file. 

I also tried compiling with HAVE_SHMGET=1 USE_SHMGET_SCOREBOARD=1 

Is there any other compilation option to be enabled.
-- Chidanand GangurPune.


Re: [EMAIL PROTECTED] Scoreboard file not created

2006-08-30 Thread Chidanand Gangur
I have a condition in my network where all of a sudden the server
becomes unresponsive I want to know what and where things are messing
up.

I am using PHP for server side scripting where I open UNIX dgram socket to comunicate to the back end. I have a test where 800-1000 user try to access the server. 

I see lot of  UNIX stream
sockets in connected state in net stat though I am using UNIX dgram
sockets. I also see the apache has reached MaxClient limit of 250.

When such condition arises I see whole of my system becomes slow. 
I want to get a clear idea where things are messing up.



 On 8/30/06, Joshua Slive <[EMAIL PROTECTED]> wrote:
On 8/30/06, Chidanand Gangur <[EMAIL PROTECTED]> wrote:> Hi,>>  I have compiled apache 1.3.34 on linux 2.4.28 the compilation went through
> fine and no issues in normal working of apache. I want to enable scoreboard> feature of apache, I have added the corresponding configuration line in> httpd.conf but still the contfiguration file but still i do not find the
> scoreboard file.>>  I also tried compiling with HAVE_SHMGET=1 USE_SHMGET_SCOREBOARD=1>>  Is there any other compilation option to be enabled.First, why do you want to "enable (the) scoreboard feature of apache"?
 Normally the scoreboard is held in shared memory, which is much moreperformant.  Why do you want to change this?Joshua.-The official User-To-User support forum of the Apache HTTP Server Project.
See http://httpd.apache.org/userslist.html> for more info.To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]For additional commands, e-mail: 
[EMAIL PROTECTED]-- Chidanand GangurPune.


Re: [EMAIL PROTECTED] Scoreboard file not created

2006-08-30 Thread Chidanand Gangur
Well I have already tried mod_status. I was under the impression that the scoreboard file would give me some more information. 

To give some more details about my test 

I have following server configuration



  Timeout   300

  MaxKeepAliveRequests  500

  KeepAliveTimeout  6

  KeepAlive On

  MinSpareServers   16

  MaxSpareServers   32

  StartServers  4

  MaxClients    250

  MaxRequestsPerChild   500

My test is:

I fire http request using curl form a simulated set up. these request
are fired at the rate of 4 request per second. Roughly there are 240
requests in 60 seconds. 

With this kind of set up I see apache reaching to the MaxClient Limit and things going.

with KeepAliveTimeout as 6 why are the process not recovering? 

I would appreciate your help to understand this scenario.

On 8/30/06, Joshua Slive <[EMAIL PROTECTED]> wrote:

On 8/30/06, Chidanand Gangur <[EMAIL PROTECTED]> wrote:> I have a condition in my network where all of a sudden the server becomes
> unresponsive I want to know what and where things are messing up.
>>  I am using PHP for server side scripting where I open UNIX dgram socket to> comunicate to the back end. I have a test where 800-1000 user try to access> the server.>>  I see lot of  UNIX stream sockets in connected state in net stat though I
> am using UNIX dgram sockets. I also see the apache has reached MaxClient> limit of 250.>>  When such condition arises I see whole of my system becomes slow.>  I want to get a clear idea where things are messing up.
If you want to look at the scoreboard, use the server-status handlerprovided by mod_status.  This won't, of course, help if your server iscompletely locked up.  But I don't think you're going to get anywhere
trying to debug the raw scoreboard. And it doesn't seem to haveanything to do with your problem.Obviously if you have 1000 clients connecting and MaxClient of 250,you're not going to get much performance.  If you want to really see
what apache is up to, use a debugger as described here:http://httpd.apache.org/dev/debugging.html#backtrace
Joshua.-
The official User-To-User support forum of the Apache HTTP Server Project.See http://httpd.apache.org/userslist.html
> for more info.To unsubscribe, e-mail: 
[EMAIL PROTECTED]   "   from the digest: 
[EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-- Chidanand GangurPune.



[EMAIL PROTECTED] This could help someone

2006-09-01 Thread Chidanand Gangur

Hi friends,

I want to share some of my observations which I found when debugging an issue with Apache reaching its MaxClient limit.

I am using apache-1.3.34 with PHP and ssl. 

I was facing a frequent problem of Apache reaching its MaxClient Limit
all of a sudden and use to stay in that state for a long time with no
other request getting served. 

This condition use to happen all of a sudden with no clues in the log
files. I noticed one important thing in netstat, there were lot of UNIX
stream sockets some in ESTABLISHED and CONNECTED state this use to
haunt me a lot. Initially I ignored it since me too had used UNIX
stream socket to communicate with the backend in my PHP scripts. 

After keen observation to the netstat output I noticed that the UNIX
stream sockets are getting created event though the PHP script was not
called. 

Finally I recompiled my apache with mod_status and got a report. I seen
Lot of threads are stuck in DNS lookups and were not able to recover. I
turned off the HostNameLookup from my conf file and belive me every
thing went fine smoothly

The UNIX stream sockets were also the result of same. Things are
working fine since yesterday. Apache is now able to serve 1000 users. 

-- Chidanand GangurPune.



Re: [EMAIL PROTECTED] How do I determine my server's name?

2006-09-01 Thread Chidanand Gangur
I am not clear with what actually you are trying to do. 
If you have two virtual hosts then you can name them with different names and act accordingly. 

Thanks,
ChidanandOn 9/1/06, David Blomstrom <[EMAIL PROTECTED]> wrote:
This is probably a dumb question, but how do I determine the name
of my server (local and online)? I have a PHP script that's supposed to
modify a value depending on whether a file is online or local, and it
requires the name of my local server. I'm using Apache in both my PC
and my Apple laptop, but I wasn't aware that my local server had a name.Thanks. 
		Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. 
 Great rates starting at 1¢/min.
-- Chidanand GangurPune.