Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache2 + php configs +kannel bridging
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
einstein1981
Guru
Guru


Joined: 10 Mar 2004
Posts: 395
Location: Venezuela , Caracas

PostPosted: Fri Mar 27, 2009 7:40 pm    Post subject: apache2 + php configs +kannel bridging Reply with quote

hello,

I'm running a server with a simple site that is used for making an smpp/customhttp service bridge

Basically I have 2 servers, one (host A)is running kannel ( smsc) and is connected with a MNO, which is sending us some sms, I have kannel posting these messages to my webserver on host B, that basically proceses these sms and formats them according to a specification, and then POSTS ( via curl_lib) to another remote host (that is not under my control). ( hope i ve not lost you yet).
This remote host after some procesing returns some results to host B ( another php script) that re-interprets it ( pretty simple) and sends it back to kannel on host A to send back to the mobile.
So basically its a 3 host route, 2way.

Everything works properly, except when the throughput of kannel gets high ( 18 sms/s), at that point it seems that apache simply cannot handle the load, and stats dropping conections on the way back ( script 2),since kannel holds the sms until it gets a 200ok message from the server, it is constantly re-filling up the socket pool ( I imagine) so basically its DoSing the 2d script.

I tried configuring apache to listen on more ports so that the uncontrolled script keeps posting to port 80 and i configured kannel to post to 2 other ports ( 8081 and 8082) to see if kannel would use up the socket pool on those ports, while the other script would have access to post back to the port 80. This did not work.

Maybe there are some config tips you could give me so that i can make this work.

some basic info on the servers is that they are not simple house machines, they actually are HP or dell servers with a big conection ( I think its T1, the server is remote and I did not set it up in the first place), 2 xeons etc.

also I want to stress that both scripts are really short and not cpu intensive, they just validate some parameters with some regexp and if all is ok curl it to somewhere else, and it would seem ( with netstat) that many conections stay open ( even the scripts have die() at each end (die sends http 200 OK) )so it makes no sense that the socket pool would be used up so quickly.


Thank you in advance


My httpd.conf is ( pertinent parts)
Code:

ServerRoot "/usr/lib/apache2"

<IfModule !perchild.c>
</IfModule>
#
PidFile "/var/run/apache2.pid"


Timeout 10
KeepAlive On
MaxKeepAliveRequests 20000
KeepAliveTimeout 3

<IfModule prefork.c>
    StartServers        32
    MinSpareServers     32
    MaxSpareServers     64
    MaxClients         220
    MaxRequestsPerChild  100000
</IfModule>
<IfModule worker.c>
    StartServers         5
    MaxClients         200
    MinSpareThreads     25
    MaxSpareThreads     25
    ThreadsPerChild     25
    MaxRequestsPerChild  0
</IfModule>

<IfModule perchild.c>
    NumServers           5
    StartThreads         5
    MinSpareThreads      5
    MaxSpareThreads     10
    MaxThreadsPerChild  20
    MaxRequestsPerChild  0
</IfModule>

<IfModule peruser.c>
    ServerLimit          256
    MaxClients           256
    MinSpareProcessors     2
    MaxProcessors         10
    MaxRequestsPerChild 1000
   
    # kill off idle processors after this many seconds
    # set to 0 to disable
    ExpireTimeout       1800
   
    Multiplexer nobody nobody
   
    Processor apache apache
   
    # chroot dir is optional:
    # Processor user group /path/to/chroot
</IfModule>

<IfModule itk.c>
    StartServers           5
    MinSpareServers        2
    MaxSpareServers       10
    MaxClients           150
    MaxRequestsPerChild 1000
</IfModule>

Listen 80
#Listen 8081
#Listen 8082

_________________
thesis.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
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