views:

190

answers:

1

Hi StackO,

Long time fan, first time posting. Hi!

Anyone notice slowness from a django dev server running on Mac OS and connecting to a remote (postgres) db? It doesn't seem to be the DNS problem referenced elsewhere. We've got a staging instance running the exact same code on the same remote staging box that's hosting the db, and the performance on that instance is very crisp.

Here's the output of the performance middleware running locally:

Total: 19.58 Python: 6.39 DB: 13.19 Queries: 17

And on the staging server:

Total: 0.07 Python: 0.05 DB: 0.02 Queries: 16

Maybe it's postgres client network overhead from connecting to the remote db, or something? I don't mind doing the development on the staging server, but it's nice being able to run things locally too.

Thanks!

Dan

+3  A: 

Two things:

  1. The Django dev server is painfully slow. Any external connections will be restricted by it.
  2. The connection to an external database is limited by your machine's local upstream and downstream capabilities (the bottleneck usually being your internet connection).

Any time you're developing locally and connecting to an external database server, it will be slow. For concurrent Drupal development at work, we source control our sites folder and use the same database that, though external, never leaves our local network. It's still like molasses in Alaska in January.

I strongly recommend setting up PostgreSQL locally and copying your external database to a local one. It isn't a very time-intensive process and will save you headaches and keep you much more productive.

cpharmston
Insanely helpful. I thought it might be a network bottleneck of some kind since I noticed it's noticeably slower at the coffee shop than at home. Sounds like a good chance to check out postgres syncing. Thanks so much!
Dan Ancona