SitePoint Sponsor

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 66
  1. #26
    SitePoint Enthusiast
    Join Date
    Jan 2002
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    are you hosting on hostony? I got my site wiped off by them for a similar reason. I am ok now with other hosts and was ok before also.

  2. #27
    Employed Again Viflux's Avatar
    Join Date
    May 2003
    Location
    London, On.
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would second the recommendation of copying the site setup to a testing machine and running some profiling tests.

    This will help you determine 2 things...

    1) If it is actually your site causing the problems.

    and, if so...

    2) What part of the code in particular is causing the problems.


    Good luck and keep us posted.

  3. #28
    SitePoint Addict CrabbyX's Avatar
    Join Date
    Aug 2004
    Location
    England, UK
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aye, I've moved server now, and the effect is still apparent. I am going to optimise each script individually, and try and bypass using an SDK for the log in.

    Apparently, even my requests to image files are slightly more heavy on the CPU--I was shown a list of requests and there was a CPU column (using WHM HTTP control panel) where my requests were somewhat higher.

    My mySQL queries are not less than 0.001 i actually meant 0.01s, most are near to 0.003 but a few are in the thirds of a second. I tried optimising one query by adding an index to the column but it made little difference.

    Viflux: How is it possible to determine what part of the code is causing the load?
    michael.Crabbe

  4. #29
    SitePoint Wizard HarryR's Avatar
    Join Date
    Dec 2004
    Location
    London, UK
    Posts
    1,376
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post Profiling your code

    Viflux: How is it possible to determine what part of the code is causing the load?
    One option you have is to profile your code, setup your site on a local machine (including database, try and make it as live as possible). Then use a professional PHP IDE (such as NuSphere PHPed, or Zend Studio) that can profile your code.

    NuSphere PHPed gives you a nice call graph comparing how much time is spent in each function, which can clearly give you a good overview of which functions are hogging resources.

    http://www.phpfreaks.com/articles/176/0.php - Tutorial using APD (Advanced PHP debugger - free) to profile code - non UI.

  5. #30
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Another question no seems to have asked yet. Where is the load coming from. Do you have a shell account on the server... if so, can you run top? Is the load coming from PHP, Apache, MySQL? That information can help you to diagnose where the problem is. A buddy of mine had issues with Apache that was causing the server to spike. Only from one site though. Something to do with the size of the output buffer going to apache. After recompiling apache the problem went away... You might look into that.

  6. #31
    SitePoint Addict myrdhrin's Avatar
    Join Date
    Jul 2004
    Location
    Montreal
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mmj
    You would probably have to write a script to do it yourself. However you'd have to make sure that the benchmarking itself doesn't take up huge amounts of their server load too of course
    So I guess that's where a function like register_tick_function() can be very usefull...
    Jean-Marc (aka Myrdhrin)
    M2i3 - blog - Protect your privacy with Zliki

  7. #32
    SitePoint Wizard Dean C's Avatar
    Join Date
    Mar 2003
    Location
    England, UK
    Posts
    2,906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This won't make a major difference but be sure to move all your rewrite rules out of .htaccess files and ditch them entirely. Put all your rules in the httpd.conf file. It is more efficient

  8. #33
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    naperville
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    RUnninbg xdebug on your code is good for profiling

  9. #34
    SitePoint Zealot TheTank's Avatar
    Join Date
    May 2003
    Location
    Houston, TX
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That seems liek a very low percentage of Queries Per second to cause a high load. I'm currently serving over 1M pageviews per month with the following server load/MySQL stats on p4 *nix box with 1G RAM:

    load average: 0.78, 0.67, 0.41

    Opened Tables/second = 0.004 (/hour = 15.977)
    Slow Queries/second = 0.000 (/hour = 0.732)
    % of slow queries = 0.000%
    Queries/second = 41.575 (/hour = 149668.634)

    I would want to know what type of hardware is on your box. That is a decent amount of traffic but shouldn't be near putting a strain on the server. I would run a top command from SSH when the server loads down to see what is draining the resourses.
    I think sometimes I dream in code.

  10. #35
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    Kelowna, BC
    Posts
    202
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    have you setup indexesin mysql? a friend of mine was having the same issue and that's what it turned out to be.

  11. #36
    SitePoint Addict CrabbyX's Avatar
    Join Date
    Aug 2004
    Location
    England, UK
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I may have solved my problem. I previously assigned a function for output buffering which manually gzencoded and reduced excess whitespace for all HTML files. I will update you with a definite answer to whether it has worked later.
    Last edited by CrabbyX; Feb 12, 2005 at 06:38.
    michael.Crabbe

  12. #37
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,741
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, mayble mysql-data-seek() function could help you. Replace dashes with underscores.

  13. #38
    Google Engineer polvero's Avatar
    Join Date
    Oct 2003
    Location
    Mountain View
    Posts
    567
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just had to ask...but you're not running an ikonboard somewhere are you?

  14. #39
    SitePoint Addict
    Join Date
    Oct 2004
    Location
    Ontario Canada
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know this site that has like 120 queries, yes one hundred and twenty!!! They get like 5K page views per month but yet require a dedicated server. Shows what too many innefective queries can do.

    I would suggest using a caching system where the page is regenerated every X minutes. If you're getting 1,000,000 page views per month this probably means multiple page views per second, so setting the cache to like 1 minute would reduce load big time, and still keep the page updated enough. My home page for example has probably like 20 or so queries, all simple selects with low limits but still enough to bog down a server if there happened to be tons of visitors, so I cache it every 15 minutes. It automaticly regenerates itself if someone goes on and that the cached copy is older then 15 minutes. output buffering is your friend, so is joins.

  15. #40
    SitePoint Addict CrabbyX's Avatar
    Join Date
    Aug 2004
    Location
    England, UK
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Red Squirrel: That is not so easy when you have to work with user sessions also. I will try and figure out if there are other ways to do it.

    The output buffering function removal seems to have improved quite a bit, but the load is still going quite high. I will try and cache more things on other pages other than the home page.
    michael.Crabbe

  16. #41
    Non-Member Musicbox's Avatar
    Join Date
    Nov 2004
    Location
    india
    Posts
    1,331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why dont you just change your webhost, many new webhost give 30 day money back guarantee so try them.

  17. #42
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    How do you find out how many queries your database averages per second and how long they roughly take.

    Quote Originally Posted by TheTank
    That seems liek a very low percentage of Queries Per second to cause a high load. I'm currently serving over 1M pageviews per month with the following server load/MySQL stats on p4 *nix box with 1G RAM:

    load average: 0.78, 0.67, 0.41

    Opened Tables/second = 0.004 (/hour = 15.977)
    Slow Queries/second = 0.000 (/hour = 0.732)
    % of slow queries = 0.000%
    Queries/second = 41.575 (/hour = 149668.634)

    I would want to know what type of hardware is on your box. That is a decent amount of traffic but shouldn't be near putting a strain on the server. I would run a top command from SSH when the server loads down to see what is draining the resourses.
    Thanks!

  18. #43
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    naperville
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm pretty sure you can find it in phpmyadmin stats

  19. #44
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sanka69
    Following up on noddy, my (former) host took my website down claiming that it was putting their servers under too much load. To cut a long story short, the host discovered faulty hardware was their problem.
    Same issue here with us, after about one month ongoing.

  20. #45
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is your server using the zend optimiser. I can tell you it makes a massive difference to the speed of the php software.

  21. #46
    SitePoint Zealot Scott.Mc's Avatar
    Join Date
    Jul 2004
    Location
    Scotland
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tryed removing certain pages?

    Do 1 page at a time, it will probley take all day but try it, you will notice what page is causing the load. Take a page down for 15minutes, if the load is still high, put it back up, and take donw another until you find out what the cause is.
    Linux Server Management - AdminGeekZ.com
    Is your website Sluggish? Unavailable? Insecure?

    Why not call us? +44 0141 2800134

  22. #47
    SitePoint Guru menuserve's Avatar
    Join Date
    Aug 2004
    Location
    florida
    Posts
    903
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i had this once on an old site... i was sending out email through a cron job... i didn't think that every registered user would ask for an update every single 15 minutes.... before i knew it we were sending out 2 million emails a day... and none of them spam.... imagine that.

  23. #48
    SitePoint Enthusiast craig34's Avatar
    Join Date
    Dec 2003
    Location
    Newton, MA
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dean C
    This won't make a major difference but be sure to move all your rewrite rules out of .htaccess files and ditch them entirely. Put all your rules in the httpd.conf file. It is more efficient
    Does this really make a huge difference? I run mod_rewrite rules in my .htaccess, can you maybe give an example of how I would move them to the httpd.conf file?
    =-=-=-=-=-
    Craig Anderson
    Intrepid Web Solutions
    Ergonomic Laptop Stand

  24. #49
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Rockville, MD
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a quick thought - in cases where you control your server, adding more RAM might be less expensive and time consuming than optimizing the life out of your code. Sure, clean,efficient code helps you sleep better at night, but we're talking business where time = money!

  25. #50
    Non-Member DaveMichaels's Avatar
    Join Date
    Nov 2004
    Location
    US
    Posts
    535
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by craig34
    Does this really make a huge difference? I run mod_rewrite rules in my .htaccess, can you maybe give an example of how I would move them to the httpd.conf file?
    cut
    paste
    restart apache

    htaccess & performance


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
  •