Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Server overload?

  1. #1
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Server overload?

    Hello all!!

    I have a php script which executes a command on the server(which is pdf2ps), I just wanted to know if it will overload the server if there are many users requesting on the server. If this will overload the server, how can I prevent it or is there any other way to do the same thing?

    Thank you all.

  2. #2
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

  3. #3
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Being that you are going to be executing a shell script, of course it will use the server resources (in this case, the processor). If quite a few users execute the same script at the same time, then their would be some server load to it (not sure if it will overload it, that just depends on the server hardware itself).

    If this will overload the server, how can I prevent it or is there any other way to do the same thing?
    If you run your own server, test it out by getting multiple users to access the script at the same time (let's make the limit at 10, then go up from there). If it overloads the server, then depending on how many users you used to test it will help you to decide whether or not to upgrade your server hardware. Otherwise, you could probably prevent this server load by making a limit to how many simultaneous connections the script could have.

    Anyways, hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  4. #4
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thetestingsite: the time the script I am using(that is: pdf2ps) takes depends on how big the user-uploaded file. So, for e.g. we have two users A and B, will A uploading a huge file make user B to wait until the request from user A is complete(as far as I know, yes)? Is there any way to prevent it?

  5. #5
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oops, forgot to tell that I am also using ps2png at the same time.

  6. #6
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    will A uploading a huge file make user B to wait until the request from user A is complete(as far as I know, yes)?
    Yes it will make the user wait, unless the script runs multiple processes. In any case, it will slow the reaction time for user B.

    Is there any way to prevent it?
    There probably are ways around this, but just not sure of them.
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  7. #7
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the quick reply thetestingsite. May be I can use ampersand(&) for multi tasking?

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Yes it will make the user wait, unless the script runs multiple processes.
    No it won't... the server handles each script in a different thread, otherwise everybody who wanted to view a page would have to wait until everybody else had done downloading it before s/he was allowed a look.

    Those two scripts deal with graphics processing, and will probably take up quite a lot of resources. You can set limits to the maximum amount of memory and CPU time per user (/etc/security/limits.conf on my distro). Create a new user, give it some sane limits, and have the shell commands run under that user instead of the one you usually use for PHP scripts. That way you can check if the program fails and return a "sorry, the server is too busy at the moment" error message, without preventing other PHP scripts from working in the mean time.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yeah, just look at rapidshare.com, if there's to many users downloading it makes you wait two minutes...

  10. #10
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by pcbrainbuster View Post
    Yeah, just look at rapidshare.com, if there's to many users downloading it makes you wait two minutes...
    That is something completely different. They have a user management type system to where if the user is not logged in, it makes them wait. Otherwise, if the user is logged in; and there are more users than the amount they have defined that are accessing the script then they make that user wait.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •