« Previous Next »

Thread: When i continuously refresh IE window then the php-cgi.exe process will increase too many

Last post 12-02-2008 1:33 PM by ksingla. 15 replies.

Average Rating Rate It (5)

RSS

Page 1 of 2 (16 items) 1 2 Next >

Sort Posts:

  • 05-31-2008, 11:15 AM

    • iisfans
    • Not Ranked
    • Joined on 05-31-2008, 2:34 PM
    • Posts 3

    When i continuously refresh IE window then the php-cgi.exe process will increase too many

    Hi,

    Currently i have setupped fast-cgi in my IIS 6.0, it works fine:).

    But i found a problem, if i continuously refresh the IE window then the php-cgi.exe process will increase too many till 20( This is my MaxInstances setting number in fcgiext.ini ) processes.

     I thought if user continuously refresh IE window and the IIS just need one php-cgi.exe to process HTTP request the other request we need to ignore them. Maybe some bad guys can use this for ddos attack.

     How can i configure fast-cgi or IIS to ignore continuously HTTP request, we just need to one php-cgi.exe process this situation?

    The following is my fcgiext.ini setting.

    ExePath=E:\php\php-5.2.5-nts-Win32\php-cgi.exe
    Arguments=test
    QueueLength=999
    MaxInstances=20
    IdleTimeout=100
    ActivityTimeout=100
    RequestTimeout=100
    InstanceMaxRequests=10000
    EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000

    Can you give advice?

    Thanks

    Jack.

  • 05-31-2008, 11:56 AM In reply to

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    You could try playing with the ResponseBufferLimit for FastCGI or limiting the number of connections to your website in IIS, but to me it sounds like FCGI is working as it should. I'd suggest if you are wanting protection against dos style attacks then you should look at investing in/leasing a dedicated firewall product.

    I also think you should look at reducing your MaxInstances value, especially when dealing with ResponseBufferLimit. In theory as long as your response never exceeds the size of ResponseBufferLimit then you will only ever need to set MaxInstances to equal the number of CPU's/Cores in your server.

     

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 05-31-2008, 1:17 PM In reply to

    • iisfans
    • Not Ranked
    • Joined on 05-31-2008, 2:34 PM
    • Posts 3

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

     Thank you for reply.

    Sorry for my english.

     I means if the one press the F5 key down then the php-cig.exe process number will increase till your MaxInstances value( maybe 2, 4 ,6 ,8 ,10 ...)  and now the other user's request will pool queue, currently it means that the other user will can't access my web site. 

    One user just press the F5 key down, it can cause web server blocking. It's so danger.

     

     Jack

     

  • 06-04-2008, 3:30 PM In reply to

    • SoHoAlex
    • Top 150 Contributor
    • Joined on 11-01-2006, 12:25 PM
    • Posts 47

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    I agree: added protection for example a maximum of 5 parse requests per IP would be awesome.
    Alex Schoenmaker, SoHosted
    Platform: Windows Server 2003 (SP2), IIS6, PHP4 and PHP5.
  • 06-06-2008, 5:24 AM In reply to

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    Maybe some very basic DoS style protection would be good, however I think this sort of functionality should be kept on a pretty short leash to prevent feature creep/bloat. Implementing something like this would incur a performance hit as every single request would have to be compared against a database to verify if the request should be served or not. It could also present problems when you site is being access via a proxy server, and wouldn't offer any real defense against DDoS attacks. Ideally this should be done via a dedicated firewall applicance/application, however I can see a lot of value for something like this for smaller environments which don't have the budget for this extra expense.

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 06-19-2008, 1:05 AM In reply to

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    brashquido:
    I also think you should look at reducing your MaxInstances value, especially when dealing with ResponseBufferLimit. In theory as long as your response never exceeds the size of ResponseBufferLimit then you will only ever need to set MaxInstances to equal the number of CPU's/Cores in your server.

    Has anyone benchmarked this with real applications? Particularly heavily loaded. This seems to be true for CPU bound applications, whereas most real apps are running many DB queries and such. I've seen references to "many long running queries" but I suspect that is on a pretty long continuum.

    Where some, but not all, requests may take 1-2 seconds due to database response time. We're running a heavily loaded app and I'd love to decrease our MaxInstances and have it improve performance, but we seem to get alot of queueing in our well performing app when we had MaxInstances set around the number of CPUs. It's an effect we haven't been able to really get at in a synthetic environment though.

     -Stephen

  • 06-19-2008, 3:10 AM In reply to

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    Hi Stephen, I did some benchmarking on this in my article on the efficiency of the go live Microsoft FastCGI handler using Drupal, Wordpress and Gallery 2. The catch with this theory in practice is this is that it only takes a handful of PHP requests to be larger in size than your ResponseBufferLimit and you get a significant performance hit. The rule of thumb I've been working with is to set MaxInstances to twice the number of CPU/Core in the system and ensuring that the ResponseBufferLimit is set sufficiently. Seems to be work so far for most PHP/MySQL based apps.

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 10-27-2008, 12:21 PM In reply to

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    Yes, i have this problem too. Some guys DOS my server.

     

    Anybody who can help me?

     

    What is the recommended firewall product for iis 6.0?

  • 11-11-2008, 2:58 PM In reply to

    • markbber
    • Not Ranked
    • Joined on 11-11-2008, 7:51 PM
    • Posts 1

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    dodomoremore123we:

    Yes, i have this problem too. Some guys DOS my server.

     

    Anybody who can help me?

     

    What is the recommended firewall product for iis 6.0?




    Yes, this problem puzzle me too. What is the anti-DoS firewall for IIS?

    F5 crashed my server, my god.

    No idea......

    What is the anti-DoS firewall for IIS? 

    What is the anti-DoS firewall for IIS? 

  • 11-24-2008, 6:59 PM In reply to

    • GinaLisa
    • Not Ranked
    • Joined on 11-24-2008, 11:53 PM
    • Posts 6

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    OMG i'm glad I found this. You are right! This is terrible how long this was posted and no fix or interest.

     Just holding in F5 floods my site and cpu jumps from 5% to 100% after a few seconds. Then if i release f5 it takes a few seconds to mins before the queue empties and then it starts serving pages again.

    How can this be fixed??? Can someone in charge at least duplicate then respond with fix.?

    Gina <3

  • 11-25-2008, 3:50 PM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-14-2006, 3:02 AM
    • Redmond, WA
    • Posts 863

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    Hi,

    This problem is fixed in fastcgi handler which ships with IIS7. Even on IIS7 you might see few instances of fastcgi process getting launched because we start processing requests as soon as they arrive but requests which gets queued for later check for connection with the client before getting processed and fail request with 500 if client is no longer connected. This protects server from F5 DOS attacks. I am following up in the team to see if we can release a fix for IIS6 fastcgi ISAPI handler.

    Thanks,
    Kanwal

    Follow me on twitter at http://twitter.com/kjsingla
  • 11-25-2008, 4:24 PM In reply to

    • GinaLisa
    • Not Ranked
    • Joined on 11-24-2008, 11:53 PM
    • Posts 6

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    Thanks for the fast response. Is there a newsletter or list I can subscribe to when the iis6 fix is released?

    Also is there a temp workaround?

    Thanks,

     

    Gina <3

  • 11-25-2008, 4:30 PM In reply to

    • TomLocke
    • Not Ranked
    • Joined on 11-25-2008, 9:06 PM
    • Posts 3

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    Would also be interested in knowing when an IIS6 fix is available.

     

    -Tom 

  • 11-28-2008, 2:51 AM In reply to

    • GinaLisa
    • Not Ranked
    • Joined on 11-24-2008, 11:53 PM
    • Posts 6

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    Bump. Any update?

  • 12-02-2008, 1:30 PM In reply to

    Re: When i continuously refresh IE window then the php-cgi.exe process will increase too many

    I would be interested in seeing this fixed in IIS 6.0. We're not going to move to IIS 7 in one fell swoop, we're going to work it into upgrade schedules. A simple F5 DDOS should be considered a pretty severe issue.

Page 1 of 2 (16 items) 1 2 Next >
Microsoft Communities