[mod_python] how to use Mysql on mod_python+apache?

Roberto C. Sánchez roberto at connexer.com
Fri Mar 30 05:48:14 EST 2007


On Fri, Mar 30, 2007 at 08:55:57AM +0200, Mike Looijmans wrote:
> 
> Another good tip:
> If the MySQL database is running on the same host as the webserver, you can 
> probably disable TCP/IP completely for the database server. The MySQLdb 
> interface is using slightly more efficient UNIX sockets (or named pipes if 
> on Windows) anyway for local connections, and disabling network connections 
> greatly improves security, since you can only make connections from 
> localhost. Putting the mysql username/password in a plaintext file is no 
> problem then. I usually use SSH to manage the database remotely.
> 
The same can probably be said of any SQL database.  A while back, I read
"The Art of SQL".  There is a section on performance tuning/improvement
where the author talks about how using network connections to talk to
the database incur a fairly large performance hit (I want to say 43%,
but I don't recall for certain).

This is similar to when have X clients speaking to an X server on the
same host.  They use UNIX domain sockets for performance.

Regards,

-Roberto

-- 
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20070330/2cfe49d6/attachment.bin


More information about the Mod_python mailing list