Support

Admin Tools

#41437 Multiple emails from Akeeba Admin Tools?

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
5.2.2
PHP version
8.3.13
Admin Tools version
7.6.2

Latest post by nicholas on Thursday, 19 December 2024 09:21 CST

jjst135

Hi! I notices that the notification email of a blocked IP was send 5 times. In Admin Tools there is just on record for the IP in the 'Auto Blocked IP Addresses' but we got the notification email 5 times (at the same time). Ant thought on why that might be happening?

Kind regards.
Jip 

nicholas
Akeeba Staff
Manager

This is normal and has to do with how your web server processes multiple requests.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jjst135

Ah, OK. And do you have any pointers on how to prevent this on our webserver?

nicholas
Akeeba Staff
Manager

You cannot. It's in the nature of how web servers, PHP, and databases work.

Web servers are multi-threaded. They can process multiple requests simultaneously, including malicious requests coming at roughly the same time from the same IP address.

Each PHP thread works independently of each other. There is no inter-process communication in PHP, at least in a way which can be used in a mass-distributed piece of software (technically there's the shmop extension, but it's disabled on most commercial hosts for good reason). As a result of that, the only way to communicate that an IP has been blocked is to use the database.

When an IP address is blocked we write that information to the database. However, there are two minor problems with that. One is that there is always a small amount of time (milliseconds) between asking the database to store some information and being able to read it from the database. Moreover, there is always some temporal distance in the PHP code execution points of reading whether an IP address is blocked, and effecting a block.

This all means that when your site is under heavy attack there will be a few PHP threads running in parallel which will all try to block the same IP address and send you an email. This is usually between 2 and 10 threads on typical server configurations. So, it's completely normal to see this, and we've written the code in such a way that it does not cause any problems with the IP blocking itself. As you said, there's only ever one database record per blocked IP address (this is intentional, and how we prevent issues with the IP blocking itself).

Working around that is possible, but it's also impractical. One solution would be using an in-memory, disk-backed key-value database with atomic read/write operations such as Redis (or its newer open source re-implementation, Valkey) to store the list of blocked IP addresses instead of using a generic RDBMS with no atomicity such as MySQL and PostgreSQL; obviously, the problem here is that virtually no commercial host offers that. Another solution would be holding a copy of the blocked IPs in shared memory using the shmop extension, but this is not only something that's usually not available on commercial hosting, but also comes with the added risk of causing breakage which requires service restarts on the server; not exactly suitable for mass-distributed software.

In the grand scheme of things, having a few emails more is a far better experience than requiring a very particular server setup that's nigh impossible for the average person to have, or risking bringing down parts of your server if we mistype a character.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jjst135

Thanks for explaining this Nicholas.And yes, as long as I know this is not some kind of bug on the website or server. I know several mails are just an indication of multiple processes running at the same time. I can therefor just ignore the multiple e-mails.

I wish you a good holiday season!

nicholas
Akeeba Staff
Manager

Happy holidays!

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!