Re: Process balancing on smp db server/apache web server
Doug McNaught <doug@wireboard.com>
From: Doug McNaught <doug@wireboard.com>
To: "Peter Darley" <pdarley@kinesis-cem.com>
Cc: "Pgsql-General" <pgsql-general@postgresql.org>
Date: 2002-05-23T15:18:53Z
Lists: pgsql-general
"Peter Darley" <pdarley@kinesis-cem.com> writes: > Friends, > I have been thinking about my smp db server and how it interacts with my > web server. I'm using mod_perl on Apache, which uses Apache::DBI to connect > to the db server via a private network segment. It occurs to me that since > the web server is connecting early (on startup), when there is probably no > load on the db server, the cpu that each backend is assigned to will be > largely random, or, if there is a large syslogd operation or something right > at that time, it might even put the majority of backends on the same > processor. Ummm.... All Unices that I know of do dynamic migration of tasks between processors as needed. When a process (or thread) is ready to run, the OS will try to pick a free CPU for it. So this shouldn't be an issue. You have to do something special to lock processes to one processor--commercial systems like Solaris and Irix have APIs to do this, and there are patches for Linux I believe. But if you just want to use the CPUs most efficiently, the default schedulaer behavior is usually what you want. Ultimately, most databases loads are I/O bound anyway, so it'd be more worth your while to worry about your disk subsystem. ;) -Doug