web pages stuck on "waiting for...", but then load fast - apache

My website has a huge data base. Even this the frontpage with all content is 1.2MB. Small. I changed server because I wanted to load faster. In the old server when I clicked the url the site started to load serially, from the top to bottom. But in the new server I get the message "waiting for www..." in my browser down left for 4-5 sec and then my website displayed very quickly. When I remove one big mysql query, it is OK.
I downloaded the htaccess of boileplate, I put in Plesk hosting settings FastCGI application, but nothing.
Any idea?

If you are getting this issues due to mysql query then I will suggest you optimize your mysql services with MySQLTuner scripts. We have used that on for our some clients and it's working good. But make sure your mysql service up-time is more than 24 hours, so that you will get accurate suggestions in the script output.

Related

Rails 3 development site is 10x faster than production site on Apache 2 + Phusion Passenger

I have a live production site (production mode) running alongside a test site running in development mode. They both run on the same machine, using Rails 3, Apache 2 and Phusion Passenger. If I load the same page on the production site, it takes approximately 4-5 seconds to load the page. If I request the same page on the test site it takes (only) about 0.5 seconds. A major difference of 10x. Always thought that production would be faster than development :( If I reload the page on the production site the load times stay the same. What is going on? How can I debug this problem? Because as of now the production site is way too slow even without any traffic.
I did some additional testing with other web servers, in particular Litespeed and even Webbrick. Both exhibit the same strange behaviour. Ten time slower in production mode than in development mode. So it probably is something Rails related. But I can not put my finger on it. Since the logs tell me the pages are rendered quickly, but it takes a hell of a lot of time before the page appears on my screen.
Thanks for the suggestions guys. I managed to get it fixed. I finally decided to load all my production data to my development server. It turned out that my sessions table was the culprit. It contained a lot of data and querying was slow. I added an index and the problem was solved.

How to optimize intranet web site

I have create a web site (PHP, MySQL) for the intranet of my campus. The campus network has a proxy and web servers but I've used a PC in my workgroup as the server using XAMPP 1.7.7 for testing purpose. When I visiting the web site from the different PC in the same workgroup it takes more than 30 seconds to load the index page or other pages.
The web browser used is Firefox and it has bypass the proxy server for the local addresses. The index.php page is only 5KB of the size. And in the index.php I have destroyed current session if there any, database connection to retrieve latest 03 news and call two external css files. Used less than 5 images (total capacity less than 5 KB) in every page. The XAMPP is in default settings.
Is there something that I can do to optimize and decrease the loading time. Your opinions are welcome.
That is very slow. Your page is not that large. If the page loads fast locally don't bother trying to optimize more. How long does it take to copy a file over the workgroup? Or better yet, FTP a file to your 'server'?
You could use tracert (http://support.microsoft.com/kb/162326) to get a better idea where the slow down is.
More generally speaking, the ideal solution really depends on what you are ultimately trying to accomplish. XAMPP is obviously more geared towards personal localhost work. You got the ports open and host all setup correctly, seems your immediate problem is a network issue requiring further diagnoses.

web site connection slow

I have apache web server and I have a django site on it.
The site use a lot of images (~50) png file.
When I refresh the page it is very slow until it come back again.
I tried to check with google developer tools network view and saw that my site have connection latency when I requesting the images..
I attached the screenshot - it is the top of the list and go on until the end..
Do you have any idea to reduce the delay?
http://2seat.co.il/static/timeline.png
If your images dont change often try using cache control headers so that your browser doesnt get the images from server every time you reload a page

Should i use nginx for my image hosting site with high traffic?

I am suggested by a friend to use nginx for my site http://www.imgzzz.com . its an image hosting site with loads of traffic.
Currently im on a vps ..CentOS 5.4 x64 , Apache
Most views are on image pages. So far to decrease the load on server i have done cache of almost all data like user details, image name, path, category details etc.
Still i have to go with about 3 sql queries every page/view.
Addition of Views
Displaying Views
Addition of user ad views with respect to their ads shown
Considering the traffic from social media sites like digg, stumbleupon. per second online user peaks upto 1500-2500. So i guess you can get the idea of php queries per second.. Sometimes it causes the server to lag.
The rest of the stuff on image pages is static. So now do you guys suggest nginx or any other better option for my server?
Thanks in advance :)
Edit : This is a custom system not any cms
I would recommend using nginx as your static file server. I run nginx for this and it works great, and I could vouch for alot of other people I know that uses it. It's fast and reliable.

My server intermittently won't serve pages to Safari 4... Need help!

I just upgraded my browser to Safari 4 and find that our website is having some major issues specific to that browser version. As I click through pages on our site it takes one or two clicks before the browser window simply goes blank. When the window goes blank, there is no source to view and no matter how many times I try to reload or if I try to load other pages of the site, I still get the blank window. It's as if the server takes the request and simply returns a blank page.
If I wait over 15 seconds and then hit refresh again, the page loads fine. Not sure why it starts working again... Maybe a cache issue???
It's a PHP site and I've tried turning on error_reporting(E_ALL);, but that doesn't give any information. I also tried putting an echo statement at the very beginning of the index.php file and verified that the page still goes blank without echoing that statement, so I'm thinking the problem is not php code specific. The Apache error log does not show any issues. I have the same site on my local development server and it doesn't have the problem.
Safari 4 is the only browser that shows this problem. Does anyone have any ideas how to debug/fix this?
My webserver is ubuntu Hardy running Apache 2 an Mysql 5.
We have an nginx load balancer in front of the apache server and I just figured out that Safari 4 requires the nginx keepalive_timeout setting to be 0. Took all day to figure that one out...
I've been having the same issue with Safari 4 on my site but found that when reloading pages that return blanks, the request never even makes it to the server. No entry shows up in Apache's logs.
The keepalive setting for your LB sounds like a direction I could sniff in. Not sure what leeway I will have though, being on shared hosting.
Mike
This looks to be a safari bug. We experience it too, and I have read other reports.
http://discussions.apple.com/thread.jspa?threadID=2064488&start=0&tstart=0