When Dolphin is having issues running, there may be two causes: Local lag or connection lag. These two things are very different and it's easy to confuse them because Dolphin's ping computation depends on having no local lag for accuracy.
UPDATE 20AUG2017: This guide is slightly outdated. The information is still accurate, but it's laid out in a more helpful form at Internet Troubleshooting and Computer Troubleshooting. Feel free to read over this guide if you find it more helpful but if you're looking for more direct and actionable information, the other guides are better choices.
First and foremost, we will look at Internet lag. This is easy to spot because you will typically see consistent pings in the netplay lobby and emulation stops entirely when your buffer runs out. This means that it feels very different from not having the local resources to run properly, which will instead drop frames during emulation and also run more frames to "catch up." Connections tend to have at most 15ms of jitter. This would be an especially bad jitter value and it would mean that if, for example, your average ping is 60ms, your ping sways from 45ms to 75ms. The vast majority of connections have 3-7ms of jitter.
If you live in the US, backbones may contribute significantly to connection lag. If they're broken (high packet loss, low network availability, or high pings), don't expect a positive experience.
There are some situations in which you would see significant spikes in the netplay lobby as a result of Internet quality. If you have significant packet loss, Dolphin won't get appropriate packets to compute ping properly. This could be a function of Internet routing or in rare cases, it could be a function of your connection.
Internet routing is important because when you establish a "direct" connection, what actually happens is the traffic is sent through roughly 10-15 different points as it travels "toward" the destination. Each spot has some picture of how to get the traffic "closer" to your destination and advanced heuristics are used in order to send traffic "optimally." For some points, that might be decreasing the quantity of hops. For some points, that might be utilizing very low-latency hops. For some points, that might be emphasizing geography. For some points, that might be avoiding points that are heavily saturated. For some points, that might be avoiding points with low availability.
However, this means that traffic may end up in bizarre places. For example, if you look at the geography of Florida and Georgia, you wouldn't think that a packet between the two might end up in Illinois. But it may depending on how routing goes. This is why major backbones being bad means that it's unlikely that your connections will be very good. It also means that "incorrect guesses" may be made - that is, each node may prioritize things that are not important to you or gaming. In addition to this, traffic may change routes every single packet. In practice, routes are frequently cached and used for speed improvements, but you can't make any guarantees as to the route that traffic will take.
This means that the lag you experience to another user isn't generally so much a function of your individual connections, it's more about the paths between you. Things like last mile saturation if you live in a particularly busy place for Internet activity or having line quality issues or using wireless may contribute to this, but in general, it's not a function of your connection. As such, there is nothing you can do about it. You might be able to get some new paths by resetting your modem, but other than that, you have very little control over the total latency between the parties. If you suspect that there's a line quality issue at play, you should definitely call up your ISP's customer service. You may need to deal with numerous low-level basic tech support before getting anybody that's useful on a technical level.
Secondly, we should look at local lag. The most common cause of local lag is the CPU. It's possible that the HD may be a contributory factor, especially if you use particularly slow magnetic platter drives. Modern platter drives of standard speeds are not likely to be a problem, but may be if there is something wrong with the disk such as reallocated sectors or sectors that can't be reallocated but are unreadable. It's also possible that the GPU may be a contributory factor, but not likely as Dolphin is very CPU-heavy and CPU-bound. It does not require significant GPU resources at the time of writing.
Having a good CPU does not alone mean that you will not have frame drops. This is a complex subject, but the essence of it is that modern operating systems schedule execution for every process on the machine. As such, there are two conditions where Dolphin may not be getting the CPU resources it needs even if you have a very good CPU.
- There is not enough CPU to go around on the system.
This is common if you are streaming or otherwise running multiple things at once. If this is the case, there is nothing you can do to solve the lag except close the other applications.
- There is enough CPU to go around, but the OS does not allocate the proper amount to Dolphin.
This can happen if other programs are higher priority or if there are simply other programs nipping away at CPU on the same processor cores. This will cause small frame drops and can be corrected by increasing Dolphin's process priority via Task Manager on Windows or some equivalent on other operating systems. I recommend increasing Dolphin's priority every time you play as a matter of course. Increasing the internal resolution in the graphics settings increases the CPU usage by a large amount, so if you've done this, try setting the internal resolution to 1x to see if that helps.
Think of it this way, Dolphin uses 1 core generally and 2 cores at most. If a program with even 5% CPU usage is allocated to execution on the same core(s), that's a 10-20% reduction in the CPU available to Dolphin and it also means that the two programs are competing for OS time allocation. It doesn't take a large amount of CPU usage to potentially manifest a problem.
On Windows, the Task Manager is a great resource for assessing and correcting these issues. You can typically tell when local lag is present by seeing huge (30ms+) spikes in "ping" in the netplay lobby. This is due to the fact that Dolphin needs proper CPU resources for its ping computation, so if it doesn't have the resources, it will not accurately represent the pings. That ping spike does not mean that the connection is the culprit. Additionally, local lag will lead to frame drops because Dolphin can't keep up with the emulation load. It will feel different from the outright stopping of emulation that happens when your buffer runs out. This type of lag will be much less consistent. If you see Dolphin taking up a full core or more, it's very likely that you've got some local lag on your hands.
Your opponent's local lag can affect you and your local lag can affect them. The important part is that you do not assume that your hardware is good, therefore it cannot be you. Always be sure to check your local system even if you don't think you're running anything else. Windows 10, for example, will run updates whenever it feels like it and you don't have a lot of choice in the matter. This will take CPU resources.