E
Eye
Guest
Oops. Invited my friends to take a look at this side... did not know I had so many.
Most users ever online was 4,626, Today at 20:29.
Most users ever online was 4,626, Today at 20:29.
Most are probably being directed from the RPGWatch Steam Curator page. As the last time the site had high number was when Obama won his first Presidency in 2009.Yikes. Do you think that figure is accurate? Seems far beyond what we'd usually see.
Correction you might be getting doxxed.
The root problem was several Chinese IPs that were continuously making connections in parallel to RPGWatch. Yesterday I figured that out and blocked the IP ranges, but it didn't help a lot. So I looked into other reasons. So I ended up balancing the memory needs for the database and Apache, to allow the site to remain alive, albeit slow.
Last night at 3 (CET), it looked OK.
Today we still had issues, so I went through the log files again, to find the same IP addresses that were apparently not blocked. It took me quite some time to find out that the addresses are only blocked when I reboot Apache, which is very odd.
After that the number of visitors dropped rapidly to normal numbers.
Every https connection will result in some database queries, as it needs to verify the user and get the configuration of that user. As a result there is an SQL connection.
Pages are cached, so when nothing changes, you get a cached pages, but first will have to get past the SQL queries.
We are using InnoDB and it likes to have a fair amount of memory allocated, so it can keep stuff in memory. Then there is PHP-FPM that needs more memory with every connection. This requires balancing the two as we are running a server with 16GB, which is usually more than enough, but not in these cases. I also never optimized the queries for large amount of visitors as there never was any need, so this adds extra delays when visiting the front page.
This stuff happens every now and then and usually the site was not reachable. Now it at least loads, slowly, but still it loads, so I call that progress
The character issue is related to a difference in the database and PHP. On the old server we used PHP 5.x and MySQL. On this server we use PHP 7.1 and MariaDB.
Our database uses Latin1 as character set, which is also the default of PHP and MariaDB. At least that is what the documentation mentions. When a connection was made with the database from PHP a character set was not explicitly set. That worked on the old server, but not here. Apparently the default is not Latin1 anymore. So, I explicitly set the character set now to Latin1 when making a connection.
Never trust defaults…
The session management is handled by the database,Thanks! The latin1 issue was what i wanted to know…
i am confuse when a connection first comes in why does it have to query the db for the user if there is no user (I am assuming that these robot hits don't actually have a cookie identifying them as a logged in user but perhaps I am mistaken?). If this the case could a short cut be made for connections that don't carry the appropriate cookie to bypass the database hit ?