: Server Processes: Websites with and without database I am on shared server and I have some limitations at "simultaneous processes". I have two websites: one which uses database and other without
I am on shared server and I have some limitations at "simultaneous processes". I have two websites: one which uses database and other without database (it's only HTML). Both are hosted on the same shared. When I reach the "simultaneous processes" the website which uses database shows "Server message: too many connections" and the second website works well and loads fast. What is the difference between sites? Both sites has ~ the same number of visitors. This happens because of database? So it's recommended to not use a database?
If I'm not on the right place, or there is a problem with my question, please tell me, I can delete it.
EDIT
Both websites has ~ 100.000 hits/day
It's a html page more faster than a dynamic page with MySQL connection? If I am using only HTML page do you think I won't have problems with simultaneous connections?
Thanks a lot!!!
More posts by @Gail5422790
1 Comments
Sorted by latest first Latest Oldest Best
I'm guessing your database has too many connections. Do you use p_connect (persistant connections)? If so, stop doing that.
Other than that, there is a setting which allows the maximum amount of connections (which you've crossed). Either optimise your queries so you have less and faster queries (so 1 connection exists for a shorter amount of time) or find a way to change the setting.
The latter might prove difficult, your hoster might pipe this down, normal settings in normal websites should not trigger this error.
You can check the current max-connections value with this query:
show variables like "max_connections";
This page shows you how to change the values, but it's very likely your hoster controls this and will not change this for you.
Unless you have a site with a few hundred hits per day (if the setting is one hundred), you should not get this message. Set indexes in your table, switch to INNOdb where you need row-locking instead of table-locking, search on integer instead of strings, use LIMIT, etc.
Another method, a bit more work, is creating cached results. If you have a menu, does your menu differ a lot, or is it sufficient to build the menu in a htmlfile and update that once per hour/day/week? Are there other pages/sections you can prebuild so the next visit doesnt need a databasehit?
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.