PHP and Multiple MySQL Connections -
i have webapp written in php creates db connection (using mysqli_connect) on every page pull data database.
recently, website has slowed down (with traffic increase), , wondering if creation of many connections - 1 every user on page - causing slow down?
is there fix this?
is possible create 1 sharable connection server? know possible in python, not know how implement such model in php.
note: site on bluehost...i don't know if makes difference.
well 2 things do.
- setup slow query log in mysql , see if there queries slow. optimize these slow queries using
explain
command identify missing indexes etc. - setup connection pooling eliminate opening connection time. see link connection pooling in php more information.
Comments
Post a Comment