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.

  1. setup slow query log in mysql , see if there queries slow. optimize these slow queries using explain command identify missing indexes etc.
  2. setup connection pooling eliminate opening connection time. see link connection pooling in php more information.

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -