Slow Internet Coonection in Mint 7 Gloria

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
theevilone6620

Re: Slow Internet Coonection in Mint 7 Gloria

Post by theevilone6620 »

I am using a Motorola SurfBoard DB5120 cable modem. Therefore I dont know if what you are talking about is possible since its not a ADSL modem????

Anyways I dont think the issue is the modem as the issue is only present in Mint and not Windows. If it was the modem it should effect Windows also.

ANyways, I am pretty much stumped as to what to do next so I need some guidance.
phil
Level 3
Level 3
Posts: 141
Joined: Sun Dec 30, 2007 12:46 pm
Location: Consejo, Belize, Central America

Re: Slow Internet Coonection in Mint 7 Gloria

Post by phil »

A little more information. I installed darkstat and got it going. It indicates that during the stalled period a new request for DNS is sent out containing 384 bytes every second until a DNS response is received, indefinitely. There seems to be a rollover of the nameservers listed. This is what seems to tie up the modem so a ping to the gateway cannot be sent.. I think it indicates that lack of DNS contact is the cause. I tried using Bind9 to see if that helped and do not find that it does, but a faster timeout does seem to help to eventurally find a nameserver. Here is my resolve.conf

nameserver 200.32.248.1 (Local telco dns)
nameserver 127.0.0.0 (This is local host bind9)
nameserver 200.32.218.132 (Local telco dns)
nameserver 208.67.222.222 (Open DNS)
options timeout:1 (Added to replace the default 5 second timeout from Linux)

Why is performance not the same as with Windows?? I use the same nameservers but not Bind9. I don't know how to set the timeout in Windows. But Windows works fine the way it comes and my original install disk is dated 2001. Crazy!!

I am convinced that with the experts available on this forum a solution will be found. Thanks for your help.
User avatar
ibm450
Level 5
Level 5
Posts: 650
Joined: Sun Jan 11, 2009 6:56 am
Location: Hamilton Hill, Western Australia

Re: Slow Internet Coonection in Mint 7 Gloria

Post by ibm450 »

what about this example:

http://www.fox2k.net/2ktweaks/tcp_broad ... %20Machine

its an old post but a rough idea to get some ideas from perhaps????

:oops:
HP EILITE FOLIO 9470M i7-3667u x 4
GitHub: tolgaerok
Image Image
phil
Level 3
Level 3
Posts: 141
Joined: Sun Dec 30, 2007 12:46 pm
Location: Consejo, Belize, Central America

Re: Slow Internet Coonection in Mint 7 Gloria

Post by phil »

Thanks ibm450, you got me to thinking and doing a little exploring. I found that the repositories have just what is need to improve caching. It is dnsmasq. I installed it and what do you know? My dns lookup time was cut by more than 50% on average. It is a bit tricky to install, but not difficult. if you are familiar with doing things on the command line. My web access for Linux is approximately the same as with Windows now. See man dnsmasq. It works, but time will tell if there are gotchas.

Thanks again for your help.
theevilone6620

Re: Slow Internet Coonection in Mint 7 Gloria

Post by theevilone6620 »

Phil,
Im thinking of installing this dnsmasq you said has boosted your speeds as mine are suffering really badly as yours were. You say that installation is quite tricky so I was wondering if you could give me a run down of exactly what installing and setting this app up entails. That way i know what I am getting myself into. I dont want to attempt this if i am going to end up really screwing up my setup and end up with no access to the net.

Thanks in advance

EDIT

However I just read this on the DNSMASQ site so I think i may have no need to install it as it is already a part of my router firmware.
Supported platforms include Linux (with glibc and uclibc), *BSD, Solaris and Mac OS X. Dnsmasq is included in at least the following Linux distributions: Gentoo, Debian, Slackware, Suse, Fedora, Smoothwall, IP-Cop, floppyfw, Firebox, LEAF, Freesco, fli4l, CoyoteLinux, Endian Firewall and Clarkconnect. It is also available as FreeBSD, OpenBSD and NetBSD ports and is used in Linksys wireless routers (dd-wrt, openwrt and the stock firmware) and the m0n0wall project.
I have a Linksys router so it is already installed in the firmware. What do you think? Do you think I would still benefit from it?
igorzwx

Re: Slow Internet Coonection in Mint 7 Gloria

Post by igorzwx »

As I remember, somebody noticed on Ubuntu forums that
the master bug (pulseaudio) can slowdown internet connection.
PulseAudio is a network server and a sound server.
Last edited by igorzwx on Wed Oct 07, 2009 9:16 pm, edited 1 time in total.
phil
Level 3
Level 3
Posts: 141
Joined: Sun Dec 30, 2007 12:46 pm
Location: Consejo, Belize, Central America

Re: Slow Internet Coonection in Mint 7 Gloria

Post by phil »

I am not sure what to think about the router situation. I thought it could be used with a router like ipcop to advantage on a private network.

Here is an article about installing dnsmasq, a little dated but it got me started.

Local DNS Cache for Faster Browsing August 2, 2006
Posted by Carthik in administration, guides, packages, ubuntu. trackback
A DNS server resolves domain names into IP addresses. So when you request “google.com” for example, the DNS server finds out the address for the domain, and sends your request the right way.
You can run a DNS cache on your computer. This will speed up the process of looking up domain names when browsing. The difference is about 30-60 ms for me. Multiply that difference by the number of websites you visit a day for an approximate estimate of the speed improvement. Of course, all this would be worth it if it weren’t for the fact that setting this up is way too easy.
The following instructions are for someone with a cable (broadband) internet connection, where the computer gets it’s local IP address using DHCP from the router in your house/office:
The package we will be using for caching nameserver lookups is called dnsmasq. So first, install it using:
$sudo apt-get install dnsmasq
(If you can’t find then, then you probably haven’t added the Universe repository to your list of repositories.)
No uncomment the following line (that is edit the line to NOT have a “#” in the beginning) in the file /etc/dnsmasq.conf:
listen-address=127.0.0.1
Now edit /etc/dhcp3/dhclient.conf and make sure the section below exactly like this, especially the line that says “prepend domain-name-servers 127.0.0.1;”

#supersede domain-name "fugue.com home.vix.com";
prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;
Explanation for the above change: In the normal case, when you get a new dhcp lease, the dhcp3 client (tool) on your computer gets a new lease, and updates the /etc/resolv.conf file on your computer with the right values for the DNS servers to use (usually some machine in the network of your hosting provider). Adding the “prepend” option as we did above ensures that “127.0.0.1″ will appear on the top of the list of DNS servers. That magic number refers to your own computer. So in the future, whenever your computer needs to resolve a domain name, it will forward that request to dnsmasq (which is running at 127.0.0.1 – your computer). If the details for the domain name are already in you cache, well and good, dnsmasq will serve it up and make the process real fast. If it is not in the cache, then dnsmasq will look at the /etc/resolv.conf file and use the nameservers listed below the “127.0.0.1″. I hope that explains things.
Now open the file /etc/resolv.conf in your text editor. It probably looks like:

search yourisp.com
nameserver 217.54.170.023
nameserver 217.54.170.024
nameserver 217.54.170.026
The 127.0.0.1 is missing right now since you haven’t renewed your lease after you edited the /etc/dhcp3/dhclient.conf file. So, let us add that in manually this one time. After you do, your /etc/resolv.conf file will look like the following:

search yourisp.com
nameserver 127.0.0.1
nameserver 217.54.170.023
nameserver 217.54.170.024
nameserver 217.54.170.026

Don’t worry if the numbers are different – if they are not, then hey – we must be neighbours
Okay. We are almost done here. All we have to do now is to restart dnsmasq so that the changes we made to the configuration file take effect. You can do that using the command:
$sudo /etc/init.d/dnsmasq restart.
Now you are running a local DNS cache. If you want to measure your speed improvement, type the command:
$dig google.com
You will see something like “;; Query time: 38 msec” there.
Now type the command again, and you should see something like:”;; Query time: 2 msec”
See, the first time, since google.com’s details were not in your cache (you are using it for the first time), the query took 38 ms. The second time, the cache speeds up the lookup. I have been using this for over a month now, and haven’t had a problem.
The following is ONLY for dsl customers
Note: If you have a dsl connection, the following may work:
Basically, the differences are in how the “conf” files are edited and used.
Copy the /etc/resolv.conf file to /etc/resolv.dnsmasq.conf
Then, edit the /etc/dnsmasq.conf file as follows:

# Change this line if you want dns to get its upstream servers from
# somewhere other that /etc/resolv.conf
resolv-file=/etc/resolv.dnsmasq.conf
You also have to uncomment the line that says listen-address=127.0.0.1
Now, edit /etc/resolv.conf to have ONLY the following line in it:
nameserver 127.0.0.1
Next, edit /etc/ppp/peers/dsl-provider and change the line:
usepeerdns to
#usepeerdns
(that is, comment out that line)
The ppp client does not allow you to prepend the 127.0.0.1 entry to your /etc/resolv.conf file. So what we did in the above was to create a copy of your previous resolv.conf for dnsmasq to use for lookups, update the file to use a local cache, and then prevent the ppp client from overwriting the resolv.conf file the next time. Now you can restart the dnsmasq service as I explained above, and start enjoying faster name resolution.
I don’t have a dsl connection, and so all the above is to the best of my knowledge.
To those of you still on dial-up – THANK YOU for visiting my blog! (I’m too ignorant to know how to change things to get dnsmasq to work on dial-up )
Husse

Re: Slow Internet Coonection in Mint 7 Gloria

Post by Husse »

Those of you that have more than one computer - can you see what speed you get from one computer to another - you could try copying an ISO or something
As I stated above you have to see this as a two step thing - first from your computer to the router and then from the router out on the internet
If we can find out the LAN speed and compare that to the speed to the internet we have found something to build on
I have about 850 kB/s in Mint on a 1000 kB/s ADSL connection - can't complain and I used to have about the same speed in XP and it seems to be about the same in Vista
Can't check LAN speed right now - Ive done something to my network configuration so sharing does not work, have to fix that first
theevilone6620

Re: Slow Internet Coonection in Mint 7 Gloria

Post by theevilone6620 »

Ok so I am kind of confused here, shouldnt the name servers be different based upon were you live and what ISP you have? The article that is posted in a post has instructions to change the /etc/resolve.conf file with a set of nameserver addresses. I dont see how this would help if they are not the ones that my ISP uses, in fact wouldnt this just break my connection to the net altogether?

Here is what my /etc/resolv.conf file looks like right now.

# Generated by NetworkManager
domain hsd1.mi.comcast.net.
search hsd1.mi.comcast.net.
nameserver 68.87.77.134
nameserver 68.87.72.134

I still cant figure out what has to be done to fix this speed issue. As ive said it only happens in Linux, Windows is way faster, in fact I booted into Windows the other night just to check it again for the first time in a while and still get around 12 to 14Mbps and Im still only getting around 4Mbps in Linux ...

Also take a look at this:

; <<>> DiG 9.5.1-P2 <<>> google.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23928
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com. IN A

;; ANSWER SECTION:
google.com. 36 IN A 74.125.45.100
google.com. 36 IN A 74.125.67.100
google.com. 36 IN A 74.125.127.100

;; Query time: 1105 msec <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< See how long its taking?!?!?!
;; SERVER: 68.87.77.134#53(68.87.77.134)
;; WHEN: Sun Sep 27 15:14:11 2009
;; MSG SIZE rcvd: 76
Husse

Re: Slow Internet Coonection in Mint 7 Gloria

Post by Husse »

I just made a reset of my ADSL modem/router and my connection is even better - response time is lower
Consumer modems and routers tend to get more or less filled with "crap" over time and a reset flushes that out
I wonder if there is something that fills the router in certain combination of hard- and software
And this is on my list of things to look at
A response time of a second as above is absurd, but I don't have a solution for it now
phil
Level 3
Level 3
Posts: 141
Joined: Sun Dec 30, 2007 12:46 pm
Location: Consejo, Belize, Central America

Re: Slow Internet Coonection in Mint 7 Gloria

Post by phil »

Yes, three violins, over a second is absurd. I also notice that the ttl in your dig is only 36 seconds. Could the problem be that the internet is bogged down at times by DNS lookups due to very short ttl offered by the DNS servers? Right now I am trying to find out how to set my own ttl to at least 24 hours. That way none of my DNS lookups would expire from day to day. I have experimented with putting some addresses into the /etc/hosts. It is quite helpful but I take the chance that a web address changes.

I also found out that Windows does have an internal caching system. There is even a command option in ipconfig to look at the cache.

We have a special case in Belize in that we only have one ISP and all internet traffic has to be routed through one undersea cable (Arcos, in case you are interested) and it has less bandwidth than a lot of you on this forum are used to.

Oh yes, and my modem gets reset very often because power goes off about three times each day due to inadequate power generation and weather.
Husse

Re: Slow Internet Coonection in Mint 7 Gloria

Post by Husse »

and my modem gets reset very often because power goes off about three times each day
That does not reset the modem - most modems have a little hole where you can push something like a paper clip until it clicks
Some wants power on some power off
After that everything is "factory reset" including user name and password
I know you would not expect anything like routing tables and the like to reside there, but it seems some modems/routers transfers such to a non volatile part of memory and it gets flushed first with such a reset
(you can search for consumer routers and the user name scorp123 for a better explanation)
When you turn the modem off it also looses more or less unwanted items :)
I think we are onto something here - the only thing that I find irritating with internet on Linux is that there are a lot of DNS look ups - I've changed a setting in the modem to make it only use the DNS servers I specify - seems to work slightly better but used it too short time to be sure
theevilone6620

Re: Slow Internet Coonection in Mint 7 Gloria

Post by theevilone6620 »

I dont really understand still as no one has answered my question about the nameserver addresses. Do they have to be the ones specifc to your ISP?

The reason I ask is because I have read in several places, were people are trying to help and solve this issue and they provide addresses for soemone to fill in their settings. Is it possible to use any DNS addresses when changing these settings or do they have to be the ones that are specific to your ISP??

Also, can someone explain to me how changing them would in fact speed up your connection?

Like I said in a previous post, in regards to that dnsmaq app, It is already a part of my routers firmware or somthing.

I also stumbled upon this and this dude apparantly is having similar problems on Debian.

[quoteA friend of mine advised me to take a look at /etc/dhclient.conf (as well as man dhclient.conf). I don't know whether this is a Debian-specific file, but at any rate I managed to overwrite the nameserver IPs in /etc/resolv.conf by adding the following statement to /etc/dhclient.conf:

supersede domain-name-servers 195.186.4.108; # nameserver IP of my ISP

As long as I only surf at home this actually solves my problem perfectly. But these settings have the disatvantage that nameserver IPs are always overwritten no matter where I surf, i.e. also at school where I've always gotten the correct nameserver IPs right away. These are now overwritten automaticly by the IP of my own ISP, which is again somewhat of a nuisance...

@ Nerderello: So the idea is that I put a script in ip-up.d that checks the current nameserver settings in /etc/resolv.conf and replaces them if necessary, am I right? I'll try. By the way I don't have a /etc/sysconfig on Debian Sid.
knockey is offline Reply With Quote][/quote]

So is it safe to say that the problem is stemming from the name server lookup times? Or is that only part of the problem? Honestly there has to be some way to fix this issue, I am still hesitant to try and install the dnsmaq as Ive read it has tanked some peoples connections so that they couldnt connect afterwards. What about another app called, "PDNSD". You can check it out here http://freshmeat.net/projects/pdnsd/.

Is that basically the same thing as the dnsmasq application? I really have hardly any knowledge of networking, and internet access issues, I actually just downloaded a few ebooks that deal with the subject intensively, they are college level books as well as preperation texts for certifications.

Anyways, who is the networking expert supposed to be around here anyways? I need to figure this out quick as Im getting real sick and tired of dealing with it. I actually heard that Fedora does not suffer from this issue at all, however Ive never been able to get my Wifi working on Fedora at all, but then again I havent tried very hard either. It may just be time to switch distros if this issue isnt solved in Mint 8 at least.

Does anyone know if using that distro that is focused on networking utilities would help to diagnose this issue? I forget the name of it but I know there is a distro that has a lot of tools for examining networking, packets and all that mess. Maybe that could provide the answer we are seeking. However, I did just read tonight that someone wasnt getting this issue when he went to school with his laptop and got on their wifi connection which would mean it was specific to his router. I have yet to take my laptop to school with me and I think Ill try that on wednesday and see what happens.
Husse

Re: Slow Internet Coonection in Mint 7 Gloria

Post by Husse »

pnsd seems top be something that addresses the same problem as dnsmasq - you find it in the repositories
In theory you can use any nameserver but the best is to always use that of your ISP
To solve the problem that /etc/resolv.conf is overwritten see this part of a wiki
Forget that it is talking about Envy - it was written when Bianca was the latest version (or possibly Cassandra)
The way this speeds thing up is that it (hopefully) makes it faster to get name resolution thus speeding things up
At worst there are look ups during a download slowing it down, this depends on both the computer and the router and the modem
If Windows has a built in DNS cache and Linux not this can explain that Linux is slow in some cases, depending on all the equipment involved
phil
Level 3
Level 3
Posts: 141
Joined: Sun Dec 30, 2007 12:46 pm
Location: Consejo, Belize, Central America

Re: Slow Internet Coonection in Mint 7 Gloria

Post by phil »

From Microsoft

To disable the DNS cache permanently in Windows, use the Service Controller tool or the Services tool to set the DNS Client service startup type to Disabled. Note that the name of the Windows DNS Client service may also appear as "Dnscache."

Note The overall performance of the client computer decreases and the network traffic for DNS queries increases if the DNS resolver cache is deactivated.

The DNS Client service optimizes the performance of DNS name resolution by storing previously resolved names in memory. If the DNS Client service is turned off, the computer can still resolve DNS names by using the network's DNS servers.

When the Windows resolver receives a positive or negative response to a query, it adds that positive or negative response to its cache, and as a result, creates a DNS resource record. The resolver always checks the cache before querying any DNS server. If a DNS resource record is in the cache, the resolver uses the record from the cache instead of querying a server. This behavior expedites queries and decreases network traffic for DNS queries.

You can use the Ipconfig tool to view and to flush the DNS resolver cache. To view the DNS resolver cache, type ipconfig /displaydns at a command prompt. Ipconfig displays the contents of the DNS resolver cache, including the DNS resource records that are preloaded from the Hosts file and any recently queried names that were resolved by the system. After a certain time period, the resolver discards the record from the cache. The time period is specified in the Time to Live (TTL) associated with the DNS resource record. You can also flush the cache manually. After you flush the cache, the computer must query DNS servers again for any DNS resource records previously resolved by the computer. To delete the entries in the DNS resolver cache, type ipconfig /flushdns at a command prompt.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNSCache\Parameters
The TTL for positive responses is the lesser of the following values:

* The number of seconds specified in the query response the resolver received
* The value of the MaxCacheTtl registry setting.


Notes

* The default TTL for positive responses is 86,400 seconds (1 day).
* The TTL for negative responses is the number of seconds specified in the MaxNegativeCacheTtl registry setting.
* The default TTL for negative responses is 900 seconds (15 minutes).

If you do not want negative responses to be cached, set the MaxNegativeCacheTtl registry setting to 0.

To set the caching time on a client computer:

1. Start Registry Editor (Regedit.exe).
2. Locate and then click the following key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters
3. On the Edit menu, point to New , click DWORD Value, and then add the following registry values:
Value name: MaxCacheTtl
Data type: REG_DWORD
Default value: 86400 seconds
Value data: If you lower the Maximum TTL value in the client's DNS cache to 1 second, this gives the appearance that the client-side DNS cache has been disabled.

Value name: MaxNegativeCacheTtl
Data type: REG_DWORD
Default: 900 seconds
Value data: Set the value to 0 if you do not want negative responses to be cached.
4. Type the value that you want to use, and then click OK.
5. Quit Registry Editor.

Mty note:

I am trying to dupllicate the above in Mint.

phil
Husse

Re: Slow Internet Coonection in Mint 7 Gloria

Post by Husse »

pdnsd is a hit!
I think it is what you are looking for Phil
It caches name resolution and to the hard drive when you shut down the computer
You find it in the repos

Code: Select all

apt install pdnsd
It also installs an application called resolvconf which finds DNS servers to use
After it's installed (with resolvconf) you don't do anything with it but you make two small edits in /etc so you might as well open /etc as root in Nautilus (be careful)
Add pdnsd to /etc/rc.local (before exit 0) this will start pdnsd at boot
Edit /etc/dhcp3/dhclient.conf
Uncomment the line
prepend domain-name-servers 127.0.0.1;
Reboot
Done
/etc/resolv.conf will now be changed so that the only uncommented content is nameserver 127.0.0.1
pdnsd works through 127.0.0.1
The response times are very low now (after the first visit to a site of course - it has to be cached first)
Pages begin to load instantly!
I have not noticed any faster download in the very small and unscientific test I made
phil
Level 3
Level 3
Posts: 141
Joined: Sun Dec 30, 2007 12:46 pm
Location: Consejo, Belize, Central America

Re: Slow Internet Coonection in Mint 7 Gloria

Post by phil »

Thank you Husse.

I do not know how I missed it . I searched the repositories but did not find it. I have installed it and it is working but I have not fiddled with the timings yet, but it looks like it is the answer. Now a simple gui setup tool would be helpful for people who are uncomfortable with the command line interface, or maybe Mint could install it for a typical user much in line with the settings for Windows which people are used to.

phil
DrHu

Re: Slow Internet Coonection in Mint 7 Gloria

Post by DrHu »

Husse wrote:I just made a reset of my ADSL modem/router and my connection is even better - response time is lower
That might be right, if the router is keeping some historical cache for its connections

However with a live Internet connection, flushing the client should be good enough
  • sudo dhclient -r
    --release dhcp
    sudo dhclient
    --reconnect/renew dhcp
man dhclient..leases data
http://linux.die.net/man/8/dhclient

And dns (host) caching services..Linux
http://www.cyberciti.biz/faq/rhel-debia ... dns-cache/
http://linux.die.net/man/8/nscd
--might not be that great as a dns cache, but for Samba (disconnected sessions; the default share method in Mint) it could be useful.
Husse

Re: Slow Internet Coonection in Mint 7 Gloria

Post by Husse »

This is a topic I will come back to - I have some ideas (and a mean keyboard - the spacebar does often not work and caps lock works to much :)) that I want to explore
Sadly the growth of Mint - which is wonderful - leaves me with so many topics to answer that I'm lagging behind
theevilone6620

Re: Slow Internet Coonection in Mint 7 Gloria

Post by theevilone6620 »

Well I actualy went ahead and installed the dnsmasq to my system and it did speed up my connection somewhat but still no where near as fast as Windows runs. ANyways, I just read the post Husse made about the pdns app, what is the difference between this and the dnsmasq app?

From what I read they do the same thing, but I see now that you are recommending it. Is there a big difference in what it does in comparion to dnsmasq? I had to manually edit some files when installing dnsmasq in order to get it to do its job and it did speed up my connection times somewhat, only after going to a page the first time though just like you said with the pdns app.

So can i expect a big diff if i switch to pdns and should i remove the dnsmasq app prior to installing pdns?

Thanks alot for working with us on this one Husse
Locked

Return to “Beginner Questions”