Для информации, получил вот такое письмо от админов unleashed, разъясняющее происходящее. Копирую сюда.
Message sent to you follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hello,
We investigated the recent performance issues affecting AlcatelUnleashed
and identified several contributing factors.
The main issue was that the forum was receiving a very large amount of
guest and bot traffic through CloudFront. Because Apache/phpBB was not
correctly seeing the real visitor IP addresses behind CloudFront, phpBB was
storing many guest sessions under CloudFront edge IP addresses instead of
the actual client IPs. Over time, this caused the `phpbb_sessions` table to
grow to more than 550,000 active session records, almost all of them guest
sessions.
This created heavy database load, especially on phpBB queries that count
guest sessions. Those queries were repeatedly scanning the large sessions
table, which caused MySQL connections to pile up and contributed to slow
page loads, login timeouts, and occasional CloudFront 504 errors.
We corrected the CloudFront/IP handling by enabling and configuring Apache
`mod_remoteip`. After this change, Apache and PHP started seeing the real
visitor IP addresses instead of CloudFront IP addresses. This was verified
directly fr om PHP, wh ere `REMOTE_ADDR` correctly showed the real client
public IP.
We also added a database index on the phpBB sessions table to improve the
performance of the session-count queries. After this index was added, the
login page response time improved significantly.
During cleanup, an initial large delete of old guest sessions was too heavy
for MySQL and had to be stopped. MySQL then safely rolled that operation
back. To avoid putting the site under heavy load again, we stopped Apache
temporarily, cleared the backed-up phpBB database queries, waited for the
rollback to finish, and then restarted Apache.
After that, we cleaned the `phpbb_sessions` table safely using smaller
batch deletes instead of one large operation. This allowed old guest
sessions to be removed gradually without locking up MySQL or taking the
database down.
In summary, the work completed included:
* Increased available disk space on the server.
* Confirmed Apache and PHP were responding correctly locally.
* Tuned Apache settings to reduce connection buildup.
* Corrected Apache real-client-IP handling behind CloudFront.
* Verified PHP now sees real client IP addresses.
* Added a better database index for phpBB session queries.
* Removed a large number of stale guest sessions in safe batches.
* Reduced MySQL pressure caused by the oversized sessions table.
* Restored Apache after database cleanup and confirmed the service was
running normally.
The site should now be in a much healthier state. Going forward, we may
still want to monitor bot traffic, phpBB guest session growth, and
CloudFront/WAF activity to make sure the sessions table does not grow
abnormally again.
If you have any feedback, feel free to email me back.
Message sent to you follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hello,
We investigated the recent performance issues affecting AlcatelUnleashed
and identified several contributing factors.
The main issue was that the forum was receiving a very large amount of
guest and bot traffic through CloudFront. Because Apache/phpBB was not
correctly seeing the real visitor IP addresses behind CloudFront, phpBB was
storing many guest sessions under CloudFront edge IP addresses instead of
the actual client IPs. Over time, this caused the `phpbb_sessions` table to
grow to more than 550,000 active session records, almost all of them guest
sessions.
This created heavy database load, especially on phpBB queries that count
guest sessions. Those queries were repeatedly scanning the large sessions
table, which caused MySQL connections to pile up and contributed to slow
page loads, login timeouts, and occasional CloudFront 504 errors.
We corrected the CloudFront/IP handling by enabling and configuring Apache
`mod_remoteip`. After this change, Apache and PHP started seeing the real
visitor IP addresses instead of CloudFront IP addresses. This was verified
directly fr om PHP, wh ere `REMOTE_ADDR` correctly showed the real client
public IP.
We also added a database index on the phpBB sessions table to improve the
performance of the session-count queries. After this index was added, the
login page response time improved significantly.
During cleanup, an initial large delete of old guest sessions was too heavy
for MySQL and had to be stopped. MySQL then safely rolled that operation
back. To avoid putting the site under heavy load again, we stopped Apache
temporarily, cleared the backed-up phpBB database queries, waited for the
rollback to finish, and then restarted Apache.
After that, we cleaned the `phpbb_sessions` table safely using smaller
batch deletes instead of one large operation. This allowed old guest
sessions to be removed gradually without locking up MySQL or taking the
database down.
In summary, the work completed included:
* Increased available disk space on the server.
* Confirmed Apache and PHP were responding correctly locally.
* Tuned Apache settings to reduce connection buildup.
* Corrected Apache real-client-IP handling behind CloudFront.
* Verified PHP now sees real client IP addresses.
* Added a better database index for phpBB session queries.
* Removed a large number of stale guest sessions in safe batches.
* Reduced MySQL pressure caused by the oversized sessions table.
* Restored Apache after database cleanup and confirmed the service was
running normally.
The site should now be in a much healthier state. Going forward, we may
still want to monitor bot traffic, phpBB guest session growth, and
CloudFront/WAF activity to make sure the sessions table does not grow
abnormally again.
If you have any feedback, feel free to email me back.
У Дарта Вейдера в столе всякого навалено: карты разные галактик и портрет Гагарина.
