I don't have a simple, quick solution for you, but I do have an idea for something that should at least work. First I'll list some trivial things you should check for - I'm guessing you've done them already, but it doesn't hurt to be sure. You haven't mentioned which OS you're using, but since it's not Ubuntu I'm guessing Windows. If it isn't, modify the details in this solution for your OS (e.g. instead of PowerShell use bash or whatever, replace utilities with equivalent ones, etc.).
- Make sure you don't have something installed and purposely configured to limit download speed, like NetLimiter.
- Check the network usage of all your running processes like atype suggested and verify that everything is low.
tracert to see if the holdup is really internal (and not, say, in your router). You said you could get good speeds to your NAS (which actually makes it less probable that it's an internal problem), so maybe there's another point in your route that's choking your bandwidth for some reason.
Complicated Test to Find the Guilty Process/Service
This requires a little coding - nothing too much, though.
Basically, the idea is to suspend every running process/service one at a time and see if your download speed improves. For this you'll need to use the Windows API as shown in the example here (just change the
GetDiskFreeSpaceW function to whichever function you need).
- List all the running processes with Get-Process.
Loop over the list and for each process:
Verify that this isn't the process running the script by comparing to
$pid (you might also need to check for parent/ancestor processes; I'm not sure).
Suspend the process using the
DebugActiveProcess Windows API function. Also, this may prove useful.
Waiting for a few seconds here is probably a good idea, but it may be OK to skip this.
With the process now disabled, test your download bandwidth. I found this page with some examples on how to do that in PowerShell, and this seems like the simplest way:
$a=Get-Date; Invoke-WebRequest http://client.akamai.com/install/test-objects/10MB.bin|Out-Null; "$((10/((Get-Date)-$a).TotalSeconds)*8) Mbps"
You can also try using this speed test script; it's in Python so you should be able to run it on another OS if you need to.
If the bandwidth passes your desired threshold (say, 1 Mbps; decide for yourself) then this process is limiting your download speed. Print out its name or process ID or whatever and stop the loop.
Resume the process by invoking the DebugActiveProcessStop function of the Windows API.
It's possible that what's limiting your download speed is a service and not a process. In this case you can do the same thing as I suggested for processes, only you need to use different API functions (Suspend-Service and Resume-Service) and you don't need to verify you aren't suspending yourself (since the script is not a service).
There may be critical system processes and services that you should avoid stopping, and possibly even can't. In case of the former you'll need to make an exclusions list, and in case of the latter you'll need to take into account that your API calls can fail (actually, you should do that anyway, and perhaps print out a warning when this happens and continue).
I know all of this is more work than you hoped to do, but it's the best idea I've got for you. I hope it helps you solve your problem.