SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    New York
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    script to limit simultaneous connections to a server

    I have this PERL script that I use to interact with the server and limit simultaneous connections to a certain directory (for downloads).

    PERL, however as you know is very taxing on the server using a lot of CPU and I was wondering if this could be recoded into PHP.

    Basically my question is -- can php work directly with the server to limit user connections?

    Thanks!
    TightBeatZ.com: Free Underground Hip-Hop loops
    Pregaming.com: Game Videos and Trailers

  2. #2
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you've got one or two users hammering the server, have a look at the sleep() and usleep() functions. If you assign a session variable to each user on your site you can then apply sleep / usleep selectively, perhaps based on how quickly they're requesting pages, to slow them up.


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
  •