**Horrible** Postgresql TCP Performance

Hi,

I've got a series of dumps that are loaded into postgresql for a crm application. Using a tcp connection to the postgresql database from my local machine - putting all the data into postgres takes over 21 minutes. I'm on a 2mbs connection.

Running the ant build file and insertion from on my linode inserting all the data takes only 49 seconds.

Why is network performance so damn horrible? I've googled and searched postgres information lists for information and similar problems but can't find anything. I've never had this problem on other dedicated (or vps) servers. So I figure it could be something to do with the linode.com setup.

Anyone have any ideas?

Cheers

Willie

3 Replies

Check postgresql's memory usage and also look to see if you're hitting the Linode's I/O limiter during the 21 minute load operation.

@willieseabrook:

Using a tcp connection to the postgresql database from my local machine

Whats the ping time between these machines?

In all likelyhood your connection is being slowed by all the back-and-forth conversation

between the two ends.

Well the dude said it was 20x faster when he ran directly from the linode, so it's probably not a memory usage or IO problem.

I use postgres and it's always been slower over a network, whether on a VPS or a standalone box sitting in the same room. I'm assuming there is back and forth communication that goes on that slows down overall throughput.

I'd suggest you run iptraf and top and maybe some other stuff to monitor resource usage as you do your postgres operations. Also you should monitor /proc/io_status. I suspect you will not see any of those resources reduced and that you will end up with a low overall average bandwidth because of the postgres protocol. But if for example you see 2M average incoming bandwidth, you know its maxing out that.

Good luck.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct