You are here: About mysql_pconnect « PHP Programming Language « IT news, forums, messages
About mysql_pconnect

Posted by Jψrn Dahl-Stamnes on 12/21/06 10:54

Hello,

I have been using mysql_connect in a script that display a lot of thumbnails
for an album. Each thumbnail is displayed using the code:

<IMG SRC="thm.php?id=some_id" ALT="some title">

thm.php use a mysql_connect to the database to access the info about the
picture based on the id.

This worked fine. However, the SQL server is located on a different network
than the web-server with a firewall between. When I looked into the
firewalls log I saw that there was large amount of new connections when
someone accessed the page where all the thumbnails was displayed.

I then changed mysql_connect to mysql_pconnect on the scripts and viola...
the amount of new connections to the SQL server dropped to only two.

Good, I thought. But later I discovered that the SQL server had a large
amount of childs running. I had 50-60 mysqld running on the system. This
number was constant to below 10 before I changed to persistent mode.

Any settings in the config file for the sql-server I need to be aware of?

I'm using MyISAM tables.

mysql> select version();
+----------------+
| version() Β  Β  Β |
+----------------+
| 4.1.8-standard |
+----------------+
--
JΓΈrn Dahl-Stamnes
http://www.dahl-stamnes.net/dahls/

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация