Consider your hoster to be an idiot and move to one who understands what he's doing.
That's like asking for an ideal number of people for a town.
No, connections and users are two things. Calling one page of your board creates 1 to 3 connections to your database, unbound to if that's a member of your board or a guest or a bot. So if one person is calling 5 topics of your board at once (speak: in his internet browser he opens 5 tabs) 5 to 15 connections to your database can be concurrent already.
That's like asking if 500 people will overload a train and asking for a safe limit for "a" train.
You do realize that "server" is also just a computer? And that it is also only limited by its hardware?
Well my webhost is recommended on phpbb on the webhost page as a recommended webhost, so it can't be that bad. See here:AmigoJack wrote: ↑Fri Dec 15, 2017 8:35 amConsider your hoster to be an idiot and move to one who understands what he's doing.
That's like asking for an ideal number of people for a town.
No, connections and users are two things. Calling one page of your board creates 1 to 3 connections to your database, unbound to if that's a member of your board or a guest or a bot. So if one person is calling 5 topics of your board at once (speak: in his internet browser he opens 5 tabs) 5 to 15 connections to your database can be concurrent already.
That's like asking if 500 people will overload a train and asking for a safe limit for "a" train.
You do realize that "server" is also just a computer? And that it is also only limited by its hardware?
Well I was told by my webhost that the default user connections for MYSQL is 100. Is that usual?Gr8Falcon wrote: ↑Fri Dec 15, 2017 7:35 pm You should use the default settings. If your board has a lot of users those figures might have to be altered, but if your server is not capable of running with default settings, I suggest you say your server goodbye.
What happens if there are users that generates more connections then lets say 100 connections, is that the greater part of the 100 "calls" is qued, and are connected as the other connections has finished. Eaven if you set it on 100, your sql-server is still able to handle more connections, but just not at the exact same time.
Who knows, you need to experiment, there isn't any one size fits all. Part of your job as a VPS owner is to make the settings to suit your purpose. Also note, server set up is beyond the scope of these support forums.
That would only be necessary if all 500 clicked at the same instant. We have seen hosts for phpBB boards that had the maximum connections set at 15.
Code: Select all
# GENERAL #
default_storage_engine = InnoDB
explicit_defaults_for_timestamp = 1
interactive_timeout = 180
pid_file = /var/run/mysqld/mysqld.pid
socket = /var/lib/mysql/mysql.sock
symbolic-links = 0
user = mysql
wait_timeout = 180
# MyISAM #
key-buffer-size = 32M
# SAFETY #
max_allowed_packet = 16M
# DATA STORAGE #
datadir = /var/lib/mysql
# CACHES AND LIMITS #
max_connections = 500
max_heap_table_size = 32M
query_cache_size = 0
query_cache_type = 0
table_definition_cache = 1024
table_open_cache = 2048
thread_cache_size = 50
tmp_table_size = 32M
# INNODB #
innodb_buffer_pool_size = 1024M
innodb_flush_method = O_DIRECT
That's because you've never used it. It takes thousands of concurrent users to to reach 500 concurrent connections.
In my experience, typical "shoutbox" extensions are extremely inefficient by nature. Most likely culprit here.
Correct! But when that time comes I would simply add more hardware to my server. Anyway, I wasn't trying to say that a 1GB VPS could handle that many connections just that it works when configured to.JoshyPHP wrote: ↑Sun Dec 24, 2017 1:05 amThat's because you've never used it. It takes thousands of concurrent users to to reach 500 concurrent connections.
1 GB of RAM split into 500 concurrent connections would leave at most 1-2 MB of RAM per connection. Even if the machine had enough CPU to handle that level of concurrency, it would have to use a lot of swap and slow down to a crawl. Or it would exceed the available swap and the kernel would just kill processes.
During peak hours I get about 80 to 100 visitors in the forum. During non-peak hours, less. Why would you lower the max connections to 100? Any reason?sakm wrote: ↑Sat Dec 23, 2017 6:23 pm On average how many users do you have online at any one time?
You maybe getting a DDOS attack at the time of the crash or back ups could be running too if you are getting out of memory messages
I would lower the max connections to 100 to be honest
What web server are you using? If apache then I would look at tweaking this for better performance and make sure you are using php7 with fastCGI enabled
2gb ram could be low but it's certainly use able with the right setup
Just to be safe I had my webhost lower the max connections to 300. What's the difference between max connections and max user connections? I thought they were the same thing. And I thought one user or guest = one user connection? This is confusing.WelshPaul wrote: ↑Sat Dec 23, 2017 9:15 pm I have max connections set at 500. Had it set at this for over a year on a 1GB VPS without issue!
Here is part of my configuration:Your max_user_connections should always be lower than max_connections. An example:Code: Select all
# GENERAL # default_storage_engine = InnoDB explicit_defaults_for_timestamp = 1 interactive_timeout = 180 pid_file = /var/run/mysqld/mysqld.pid socket = /var/lib/mysql/mysql.sock symbolic-links = 0 user = mysql wait_timeout = 180 # MyISAM # key-buffer-size = 32M # SAFETY # max_allowed_packet = 16M # DATA STORAGE # datadir = /var/lib/mysql # CACHES AND LIMITS # max_connections = 500 max_heap_table_size = 32M query_cache_size = 0 query_cache_type = 0 table_definition_cache = 1024 table_open_cache = 2048 thread_cache_size = 50 tmp_table_size = 32M # INNODB # innodb_buffer_pool_size = 1024M innodb_flush_method = O_DIRECT
max_connections = 10
max_user_connections = 5
I don't have any value set for max_user_connections but if I did, i'd start at 50 and adjust as necessary. Using a low value is usually best, this normally isn't a problem because MySQL connections are made and destroyed within a fraction of a second. If you are getting a max_user_connections error:
Max Connections is the total connections allowed overall and Max User Connections is the total connections allowed per user.
- Your code is opening the connection to the database, but not closing it.
- Your software is configured to use pconnect / Persistent Connections.