SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear all,

    I have some perl and server performance question.

    I am running a dedicated server. I just change a new program at my web site. But after I change to the new program, the server become too slow to run.

    One possible reason is the new program. Because it's running in perl and mysql. The old ones is just perl and normal text file.

    Another reason is the Apache configuration. Because a lot of web sites are linked to my old program e.g. /cgi-bin/top/script.cgi. But the new program is located at /cgi-bin/new/script.cgi. There are some reasons that I can't just replace the new script with the old script. I need to make it in another directory. So I need to set Permanent URL redirects in Apache server in order to make the new and old program work great. That means,I need to redirect all traffic from /cgi-bin/top/script.cgi to /cgi-bin/new/script.cgi.

    So I would like to know is it the main reason for my website to slow down? Because I just think if I do redirection in this way, the Apache server will have double amount of traffic (i.e. redirect from one place to another place).

    Does any one have any idea?

  2. #2
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you know if your server is running mod_perl, ie the Perl module for Apache? If not, then that might be causing a slowdown.

  3. #3
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In theory MySQL should be faster than using flat file databases (Normal Files). You don't mention what type of script it is or what the server specs are.

    It probably, like you though, has something to do with the re-directs, but I can't see why it would have such a big effect as it is not double the traffic because the re-direct only sends a header and not a full page.

    I suspect that your server was running borderline before you change your script and now that MySQL has to run it has pushed it over the edge in terms of memory usage. If you have the option then I would suggest more memory in your server.

    I hope that's all clear.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  4. #4
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    James, but the perl script is not especially for mod_perl. My server already configure as mod_perl with mysql.

    Karl, yes, my server almost go to the borderline before changing to the new program. I have around 500000 page view per day. My server configuration is :

    CPU : 450
    RAM : 384 MB
    HD : 9.1 GB SISC HD.
    Platform : Linux.

    It run fast before the changing. But after change to the new program, the speed is too slow to accept.

    Bear

  5. #5
    SitePoint Guru prequel's Avatar
    Join Date
    Nov 1999
    Location
    Brisbane, Australia
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well you might need to change the default settings in MySQL. when i installed vBulletin on my dedicated server the bottleneck was MySQL's default settings...


  6. #6
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Prequel,

    What settings in mysql should I change? Please give me some hints :-).

    Bear

  7. #7
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all, I forget to post what is my server status from top.

    The following is before changing the program :


    12:47pm up 92 days, 17:51, 1 user, load average: 7.18, 7.61, 12.50
    175 processes: 164 sleeping, 2 running, 9 zombie, 0 stopped
    CPU states: 53.2% user, 22.1% system, 0.0% nice, 24.6% idle
    Mem: 387440K av, 204388K used, 183052K free, 276732K shrd, 46760K buff
    Swap: 131504K av, 25084K used, 106420K free 83760K cached
    
    PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND
    2062 hchan 5 0 724 688 312 R 0 3.8 0.1 2:18 top
    15461 nobody 16 0 1508 1508 892 R 0 1.6 0.3 0:00 topsites.cgi
    14672 nobody 0 0 1952 1952 880 D 0 0.0 0.5 0:01 create.cgi



    The following is after changing to the new program:

    12:21pm up 92 days, 17:26, 1 user, load average: 48.27, 38.94, 21.95
    341 processes: 279 sleeping, 50 running, 12 zombie, 0 stopped
    CPU states: 87.3% user, 12.5% system, 0.0% nice, 0.0% idle
    Mem: 387440K av, 373292K used, 14148K free, 185276K shrd, 9252K buff
    Swap: 131504K av, 30200K used, 101304K free 17672K cached

    PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND
    7639 nobody 20 0 3752 3752 1020 R 0 2.1 0.9 0:00 topsites.cgi
    2062 hchan 11 0 708 708 304 R 0 2.0 0.1 0:59 top
    7638 nobody 19 0 3364 3364 1020 R 0 1.9 0.8 0:00 topsites.cgi
    7605 nobody 10 0 3104 3104 1020 R 0 1.8 0.8 0:00 topsites.cgi
    7631 nobody 10 0 2864 2864 1004 R 0 1.5 0.7 0:00 topsites.cgi
    7633 nobody 10 0 2912 2912 1004 R 0 1.5 0.7 0:00 topsites.cgi
    7636 nobody 10 0 2820 2820 1004 R 0 1.5 0.7 0:00 topsites.cgi
    7637 nobody 10 0 2784 2784 1004 R 0 1.5 0.7 0:00 topsites.cgi
    7628 nobody 10 0 2696 2696 988 R 0 1.4 0.6 0:00 topsites.cgi
    7617 nobody 10 0 3136 3136 1020 R 0 1.3 0.8 0:00 topsites.cgi
    7618 nobody 10 0 3172 3172 1020 R 0 1.3 0.8 0:00 topsites.cgi
    7620 nobody 10 0 3204 3204 1020 R 0 1.3 0.8 0:00 topsites.cgi
    7622 nobody 10 0 3048 3048 1004 R 0 1.3 0.7 0:00 topsites.cgi
    7623 nobody 10 0 3020 3020 1004 R 0 1.3 0.7 0:00 topsites.cgi
    7626 nobody 10 0 2996 2996 1004 R 0 1.3 0.7 0:00 topsites.cgi
    7609 nobody 10 0 3344 3344 1020 R 0 1.2 0.8 0:00 topsites.cgi
    7616 nobody 10 0 3164 3164 1020 R 0 1.2 0.8 0:00 topsites.cgi

    After change to the new program, I can't even go to my homepage. I need to top the new program and retart the Apache server.

    So from the above information, should I just change the setting of Mysql file or upgrade my hardware? Thanks a lot.

    Bear

  8. #8
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think changing mySQL settings would probably help a bit but it does look like you are running very low on RAM (only 14Mb free in the 2nd lot of stats), so if possible, upgrading to 512Mb might be a good idea.

  9. #9
    SitePoint Zealot Website Rob's Avatar
    Join Date
    Aug 2000
    Location
    Alberta, Canada
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe it's just me (wouldn't be the first time ) but why would you be running PHP and/or mySQL from the cgi-bin? Only Perl scripts need to be put there. You say the "new" script is PHP/mySQL yet refer to it as /cgi-bin/new/script.cgi???


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
  •