I have what I think may be a latency problem. I have a magento installation on a shared host. I know it's best to run magento on a dedicated server but it's early days and it's a good host. When I bring up the front page and check it in the net tab in chrome the page itself ( ie the main file the first to be received ) takes a lot longer to load than I'd expect ... about 3 seconds on average. When I looked closer though i noticed that i was "sending" for a couple of miliseconds, "waiting" for more like 2.5 or three seconds and then "receiving" for only about fifty mS. Is this a latency problem?
Your issue isn't latency - it just a slow site. Latency could quickly be measured with a quick ping:
Your issue is Time To First Byte (TTFB), whereby your server isn't generating the response very quickly and as a result, your browser is waiting until it does.
Ie. If you created a PHP script with the following:
Then your TTFB would be 10 seconds.
So your issue is going to be 2-fold.
Write a more efficient template, remove the slow/bulky badly written extensions and change your host.
Make sure all your caching is turned on in magento. That way the first load will be slow but since all the xml/configs are cached it will be quicker.
The first load is just after a cache clear. Magento will run pretty slow anyway on shared hosting. It needs pretty big hardware to run quick.
The only definitive way to confirm whether you're experiencing latency issues, and I assume you're talking network latency, is to perform a trace with something like wireshark. You can use tools like SysInternals' ProcessMonitor on the client to see what's going on at a higher level, but a good old Wireshark .CAP file can't be beaten.
As for server performance, you need some metrics. All too often we hear that an application needs a hex-core Xeon, with 32GB RAM and lots of 15K spindles. Then you actually run the beast to find that it's only the RAM that was required, and you're left with six cores ticking over at 8% utilisation, and very little intensive disk I/O. Just me having another soap box moment, sorry!
So, on your server, see if:
o The disks are having to queue requests o CPU(s) are maxed out o Memory utilisation is OK, and that paging isn't taking place
I'm no MySQL expert (actually, I'm an MySQL noob), but I don't know whether it has many configuration parameters, a'la Oracle. Might be worth a look. I'm thinking along the lines of pinning database pages in memory to increase performance. This'll only work if you've got spare RAM in the first place.