Traffic usage by PHP


Verified User
I'm hosting several wordpress websites for my resellers who are using Wordpress and the Updraft plugin.
This plugin is uploading backups to different external locations.

The traffic used by this plugin is not monitored/metered by any counter in directadmin.
With nethogs i have found one of the users causing this traffic, (3 GB each day) and in directadmin the user has a total month use of 600mb.

Is there a way to count this traffic ?
I'm using PHP in PHP-FPM and with nethogs i see clearly PHP-FPM: Pool [username].


Verified User

Write a custom script for it to get data from iptables, and in iptables use UID to match traffic of your users. PHP scripts should run in behalf of real users (script owners).
So if I understand correctly, i need to activate the Iptables owner match extension, and use the IPtables Stats for logging the traffic used by all processes of the owner him self ( maby excluding traffic used metered by Directadmin Apache & Mail ) for complete and accurate traffic metering ?