Find the answer to your Linux question:
Results 1 to 10 of 10
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Web sites loading slow on Apache-MySql


    I'm running virtual Scientific Linux on Windows 2008 Hyper-V.

    My PHP web sites are taking a long time to load. DNS server is on Windows 2008.

    Here is an example slow loading site:

    What can be the problem?


  2. #2
    I don't know about PHP in specific, but in general, that blog page has a lot of external js/css, etc. I would try commenting them out and seeing if that makes a difference. I know that breaks the design, but you're trying to find out what is making it slow, and there are ways to add that stuff back in but in a more efficient manner.

    There are lots of guides out there that try to help web folks speed up the page-loading of their web sites. Try this one:

    Also, don't forget to keep an eye on Apache's logs for any additional clues (try looking in /var/log/httpd/).

  3. #3

    Thanks a lot for your reply. Actually, I realize that probably I described the problem wrong. Site is not slow, there is a long delay on load.

    I suspect it can be MySql or DNS problem. This example site works on IIS, but uses MySql on Linux. Other sites running on IIS load fine. But my sites running on Apache also has a delay. I'm not an expert of MySql so I couldn't do tuning.

    Do you also think it can be MySql or DNS problem?


  4. $spacer_open
  5. #4
    Linux Engineer
    Join Date
    Apr 2012
    Virginia, USA
    Pingdom Tools

    That's a tool I like to use for some of my sites.

    Doesn't look like a DNS problem. It's taking a long time for your server to generate and send the page. This is likely caused by a broken MySQL query or PHP problem.

  6. #5
    Hello mizzle,

    Thanks a lot for your answer. As you say this is probably a DB or PHP problem. Because;

    1. Web sites running on VM Linux are problematic,

    2. Web sites running on Windows 2008 are fine,

    3. However, this example site is running on IIS, but it is using MySql on Linux for the Blog section. ASP pages run fine, but PHP Blog page has a delay.

    All databases are created by Wordpress, so I think they might be fine.

    But as you say there might be a problem in PHP. I'm using the default PHP settings. Which setting might be responsable for this problem?

    Thanks again.

  7. #6
    Linux Engineer
    Join Date
    Apr 2012
    Virginia, USA
    I don't know. You'll have to dig around and tinker until you figure it out. When I say php problem, I don't mean server settings, I mean your blog's coding.

  8. #7
    ah ok. but because all the sites have a problem, I thought it is probably not because of their DB or PHP. even fresh installed wordpress sites have a long delay on load.

  9. #8
    After an experiment, I highly suspect this is related to MySql or PHP general configuration.

    As I said example site was on ISS, with DB on Linux.

    Now I installed MySql on Windows, imported DB, & configured blog to use this one. And again a long delay.

    Since all sites use standart Wordpress created DBs, I think this is a general config problem.

    Are there MySql or PHP config settings that can cause this delay?


  10. #9
    Quote Originally Posted by gezginrocker View Post

    Are there MySql or PHP config settings that can cause this delay?
    i don't know squat about PHP, but with MySQL there can definitely be delays. Here is one idea: you can insert warnings in your code, sent to STDERR, that should get printed to the Apache error_log. So you could just put print statements before and after mysql queries in your code (or anywhere in your code that you suspect delays might exist). Then start a running tail of the apache log in a window. then load the page from a browser, and watch the error_log and see if the delays become obvious there.

  11. #10
    After doing some research I tried those, but both didn't help.

    For MySQL, I tried adding skip-name-resolve.

    For PHP, I tried changing localhost to at PHP MySQL settings.

Posting Permissions

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