Any way to find out what my shared hosting "lag" is? - performance

I have shared hosting with hostgator and until about a month ago, things were dandy. Now.. every 2 to 3 minutes, I'll click a link and the browser won't resolve for about a full minute. This is any of my sites.. and links that are both database calls or very simply html hyperlinks. It's with any browser and at work or home.
I've opened 2 tickets with hostgator and they swear all their tests show that there are no problems, but.. I get this over and over and over again.. and have for weeks now.
Is there any kind of error outputting I could do.. or tools of any kind that would allow me to troubleshoot this myself?

Not sure about other browsers, but Google Chrome has a tool to measure the time a website took to load. Click the wrench icon in the top right, then go to Tools -> Developer Tools. Then you will see a new section at the bottom of the screen. Click the Network tab and it will show you a lot of data about the latency etc. It will also show you which file is the one that is taking the longest. Hope this helps.

From a console on the server itself, use the wget command to pull a page. Do it periodically in a script, logging to a file. Put it in cron. That'll show you if there are any lag issues with the server itself. If that looks good, then it's somewhere in the network. You could do a similar test from another box on another provider, which if comes up clean, points to your ISP or DNS as the culprit.

Related

CodeIgniter Blank Page

n00b here. After searching the forums I have not yet come across this problem as I am experiencing it.
I have a CI site that was working correctly until about three days ago. My problem is as follows:
On button click - Page Loads correctly.
On Enter press - CI Blank Page of Death loads.
For example: When I login, after the login process has run it must reroute me to the Dashboard, unless I still have a temporary password where I get rerouted to the "Change Password" screen first and then to the Dashboard.
AS LONG AS I USE THE BUTTONS AND CLICK THEM EVERYTHING WORKS.
On ENTER PRESS, I get the Blank Screen of Death.
However, on TAB to BUTTON and then ENTER it works.
The problem is not consistent however. I have some processes that do not have views attached and NONE of them will run - hit ENTER and get blank. They are all failing on ENTER PRESS.
I am slowly going off my trolley. Logging is ON, Directories for cache and logs are 775. NOTHING is showing in my logs...
First Try to active error handlers for displaying of errors for addittional info to post here what error is occuring..
// change settings for error handler to show errors
// $this setup is used for checking errors for development to be shown....
ini_set('display_errors', 1);
error_reporting(E_ALL);
by the way if your using CI version 2 higher
you can see it in its index.php file an configuration for displaying error also.
define('ENVIRONMENT', 'development'); //just set up environtment to development
Even though there are accepted answers I wanted to add a way that worked for me to figure out this problem.
Usually the "Blank Page" indicates a PHP parsing error somewhere in the code. Strange thing for me was that on my local MAMP based test server the code ran fine. I FTP it to my hosted server and all of a sudden, blank page of death.
Even though I had errors on, log errors on, display errors on, nothing appears in any log file.
I was able to find the error by a funny little trick. I added an echo line in CodeIgniter.php in the system/core. Obviously hacking the core was not a great idea but all I wanted to do was to see how far it was getting in the load process.
When my echo appeared after trying to load a page on the remote hosted server it also displayed the parsing problem in a derived controller! Not sure why the error did not come out without the "echo" added. But adding it seemed to trigger some output to be generated, IE my echo line and the PHP parse error was appended.
Not sure if this will help anyone but it turned out to be a nice easy way to find the error which only showed on the remote server.
Obviously, don't forget to put your core file back to its original state without the echo.
This was fixed by copying the application into a fresh CI 2.3 install.
I have no idea what actually caused this "erratic" behaviour.
The application worked correctly as designed whenever a BUTTON was CLICKED but gave the blank death screen when ENTER was PRESSED.
This inconsistent behaviour is what threw me. The fact that my logs (CI and APACHE) also showed nothing was also very strange. Had this been a parse error, surely the behaviour on "Click" and on "Enter Press" should have been the same.
My non-view controllers for various ad-hoc admin jobs are now also working correctly, which they were not before, as they use "Enter Press" (having no buttons to "Click").
I am still going to invite best guesses as to why this behaviour occurred the way it did.
Surely someone out there (Phil Sturgeon et al) with extensive CI experience has encountered this non-consistent blank screen behaviour and knows what caused it.
Thank you to all the people who took the time and effort to assist me!!!
Big UP!!! StackOverflow!!!
probably error in INCLUDE login.php
My problem was Apache stop working because of ...Skype! Skype actually work on the same 443 and Apache didn't start! I hate this Skype! Bring me nuts for a while.
Installing php5-pgsql worked for me

Trouble on localhost: Must update page many times

I'm currently making a webpage and running it locally on localhost for testing. But whenever I make a change to that page and want to see the result in the browser I run into a "problem". I have to update (press F5 or the update button in the browser) several times for the site to show. In the meantime it's just white...
Let's say I have the site up in my browser (looking good), and then I make a change and want to see it. I press the update button in my browser one time and the site is now just white. I press it again and again, but it stays white. Until I press it a random number of times, and it works. Sometimes I just have to update once, and sometimes I have to update 7-8 times. Sometimes it's fast as hell, and other times it's slow as my schools computers.
Does anyone know if there might be a problem with the site itself (and this problem will continue to exist, even after I upload it to the server), or if it's just a problem with my internet/ computer/ known problem when running on localhost?
I'm using XAMPP on a Mac and have tried testing the page in both Safari and Chrome.
Thanks for all the tips in advance!
From Europe with a problem,
Alekplay
EDIT 1:
It turns out Chrome decided to give me an error message instead of a white screen now. It says "no data received", and Safari is still just blank. Any ideas? I've tried turning off caching.
EDIT 2:
Did some tweaking here and there, and found out that it's SimpePies autoloader.php that's causing my problems. Any of you have any knowledge around SimplePie, and know how I can make the site load faster? It's fine when I've commented out require_once('php/autoloader.php');, but I need that for my feeds to load. Any ideas?
Into chrome you can turn caching off. Just take a look to this page :
http://geek.michaelgrace.org/2011/09/disable-google-chrome-cache/
With Chrome: CTRL+SHIFT+R
I don't know about Safari.
That may be something related with the cache or with apache itself.
Find out if you have any error on apache's error.log. It might be related to an error similar to this one:
AH00052: child pid 62969 exit signal Segmentation fault (11)
then you should check: "[notice] child pid XXXX exit signal Segmentation fault (11)" in apache error.log
Basically it states to try to increase output_buffering in your php.ini
You would have to run a backtrace on the coredump to know why it crashed, as indicated elsewhere. In mi case it was APC, and the error went away as soon as it was disabled on php.ini. Yours might be because some other cause.

How to produce a XHR log silently with Chrome

I would like to spot a "random" bug on a site. In order to do that I would like to have all the XHR requests saved in a log file, which is a very easy thing. The problem is that I'm not the user, so I have to set up someone else's machine to do that.
The problem is that the user doesn't know how to use the "developer tools" so I would like to have a tools that keep trace of everything without bothering the user. Bear in mind that this bug can occur once in a day and during this time the user can close the browser and re-open it. Do you have any suggestion? thanks!
I think that the best way would be to make the logs from within the site that you're trying to observe.
If you don't have access to it, another solution might be to find/develop a browser extension that logs any xhr to a local file.

Auto open Chrome web inspector for all pages

I need to trace redirect using network tab, but it works only if I open web inspector and then reload page. Unfortunatly, I open this page from external native program and need to found, which URL is passed to browser. Is it possible to do this? I bneed to do this on Windows 7.
As far as I know this isn't possible. The complete list of up-to-date chromium command line switches can be found here: http://peter.sh/experiments/chromium-command-line-switches/
I thought you might be able to to get something working using --wait-for-debugger-children, giving you enough time to open the developer tools before the page loads, but setting that flag also gives the developer tools a 1 minute delay before loading.

Download file not working on internet explorer 6 (only for certain people)

I am working on an ASP.NET MVC3 webapplication.
I have a button "Download" that downloads a file from the server.
<input type="button" onclick="window.location.href='#Url.Action("DownloadFile", "Home")';" value="Download"/>
In the HomeController I call the Action "DownloadFile" that returns the file
return File(fileToReturn, Path.GetFileName(fileToReturn));
This is working normally on all browsers.
however some people report that the download does not work on Internet Explorer 6.
I installed IE6 and tested the website on it and it was working normally.
So this is my question:
What may have cause the download to not work for certain IE6 but work on others?
First I thought it was a security option in IE. But then I tested on my IE6 for different security option, When I cannot download due to security reason I get a message Your current security settings does not allow this file to be downloaded But they are not getting this (the file just does not download without anything happening)
What may be causing this? I am unable to reproduce it in order to fix it.
Thanks a lot for any help
I had a similar problem once and managed to fix it by following these steps:
In Internet Explorer, click Tools, and then click Internet Options.
Click the Security tab.
There are four security zones listed: Internet, Local intranet, Trusted sites, Restricted sites. Click the zone your website is in (when you navigate to your site, the current zone is displayed in the status bar at the bottom of IE's window).
Under Security level for this zone, click Custom Level.
Under Downloads, under Automatic prompting for file downloads, click Enable, and then click OK two times.
You say you've checked that it isn't browser security settings, but it might be security settings on their network, not just the browser.
If their network firewall is configured to prevent certain types of files from being downloaded, then there may be nothing you can do to get around that, short of changing the file type you're sending. (or talking very nicely to their network operator).
Given the security risks involved in running IE6 these days, I imagine most companies still using IE6 would have pretty paranoid network security settings, so this is quite a likely explanation.

Resources