mysql-pconnect

mysql connection from daemon written in php

倖福魔咒の 提交于 2019-12-11 06:25:58
问题 i have written a daemon to fetch some stuff from mysql and make some curl requests based on the info from mysql. since i'm fluent in php i've written this daemon in php using System_Daemon from pear. this works fine but i'm curious about the best approach for connecting to mysql. feels weird to create a new mysql connection every couple of seconds, should i try a persistent connection? any other input? keeping potential memory leaks to a minimum is of the essence... cleaned up the script,

MySQL persistent connections and advantages of mysql_pconnect?

时间秒杀一切 提交于 2019-12-01 01:14:22
问题 I had never heard of persistent connections before, and I don't understand the advantages. I run a PHP/MySQL based website, it receives tens of thousands of page views per day. In my header file on each of these pages I have just used mysql_connect() and I haven't bothered with terminating the connection in the footer file. In my case are there any advantages of using mysql_pconnect() ? 回答1: Using a persistent connection leaves the connection open after the script has finished executing.

mysql_pconnect(): send of 5 bytes failed with errno=32 Broken pipe

一笑奈何 提交于 2019-11-29 20:51:32
问题 I've been using the same DB abstraction library for years. But today it started writing these Notice (8) messages in my log. The application is working correctly but every time a script connects to the DB the same notice is logged. I cannot think what might have changed. This is happening on my local dev machine. OS X 10.6.2 PHP 5.3.0 (cli) mysql Ver 14.12 Distrib 5.0.87 mysqlnd 5.0.5-dev - 081106 - $Revision: 1.3.2.27 $ 回答1: If someone is struggling with this issue, here is the fix: Try

mysql_connect VS mysql_pconnect [closed]

感情迁移 提交于 2019-11-26 16:02:14
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I have this doubt, I've searched the web and the answers seem to be diversified. Is it better to use mysql_pconnect over mysql_connect when connecting to a database via PHP? I read that pconnect scales much better, but on the other hand, being a persistent connection... having 10 000 connections at the same time