SLOW localhost transfer
i have a problem with performances when accessing a service on tcp ports on localhost or on eth interface address of the local machine. I tried with more services (POP3 , MySQL) and i have 3-10 times !!! better performances when i access these services from different machines thru LAN. For example, when i retrieving 250 messages from POP3 server from the local machine the operation costs 10 seconds, and from other machine thru the net i have 0.8 seconds.
I tried several llinux distributions and several kernels (2.4 and 2.6), and also tried on several different machines but the behavior is the same. The problem is 100% not with DNS.
Does somebody know what could be the problem ?
Thank you !!!
POP3 transfers cannot be really be compared as being the same if you are not downloading the same set of messages. There is also other factors such as the load on the server.
The fact that you have varied pretty much everything like machine, distro, kernel, etc makes it a very strange problem. Something you didnt make clear when you said you changed machines, is this the machine you are finding slow when connecting locally, or is this the machines you are connecting from externally?
I retrieved the same set of messages, of course. The connection is slow when it is made locally. So, I will try to explain my experiment:
On machine A is a pop3 server with mailboxes. I made a perl script which login to pop3 server on machine A and retreive all the messages. When I run the that test program on machine A (i tried 127.0.0.1 and also the address of the ethernet interface) time for retrieving all messages is about 10 seconds. When I run the test script from some other machine B (thru LAN - connection from machine B to machine A) the same operations gets only about 1 seconds.
All test machines are P4 on 2.8 and 2.0 GHz completly unloaded without any running services. I tried gnu pop3, popa3d and tpop3d daemons and the results are same.
I also tried with mysql server on machine A, and client on the same machine A (result of large query "select * from ...") result was 12 seconds, and when the client is on machine B the result was 7 sec.