There is a casino script that works on php and flash games. Installed, configured everything worked well, but a week later there was an overflow of disk space on the hosting (12GB). The casino itself weighs about 2.1GB. Here is what the hosting replied:

"Because of the incorrectly configured site script, or the mass of errors in it, or the logging level, the logs are clogged.

root@server:/# du -sh /var/www/admin/data/* 4.0K /var/www/admin/data/email 8.0K /var/www/admin/data/etc 13G /var/www/admin/data/logs 4.0K /var/www/admin/data/mod-tmp 0 /var/www/admin/data/tmp 712M /var/www/admin/data/www 

The logs have been cleaned, but you need to configure the site script, if it works normally, then reduce the error logging level or turn it off completely using error_reporting "

We concluded that most likely the user’s action history is filled in games and I thought about the logs. We restored the backup, the ISP started working again and I started to solve the problem. Disable logs with:

php_value error_reporting 0 php_flag display_errors off php_flag display_startup_errors off

in the .htaccess file, but that didn't help, the memory continued to grow again. As explained to those hosting support:

"At the moment there are no problems with the logs (with their sizes), but notifications are written as they were. If the php_value error_reporting 0 logging is not disabled, the site’s cms script adjusts its settings (replacing the current server settings). This is usually called debug mode, or logging mode. You need to google by your cms.

 root@server:/# du -sh /var/www/admin/data/logs/* 1.9M /var/www/admin/data/logs/gamegods777.com.access.log 16K /var/www/admin/data/logs/gamegods777.com.access.log.0.gz 12K /var/www/admin/data/logs/gamegods777.com.access.log.1.gz 40K /var/www/admin/data/logs/gamegods777.com.access.log.2.gz 4.0K /var/www/admin/data/logs/gamegods777.com.access.log.3.gz 56K /var/www/admin/data/logs/gamegods777.com.error.log 4.0K /var/www/admin/data/logs/gamegods777.com.error.log.0.gz 4.0K /var/www/admin/data/logs/gamegods777.com.error.log.1.gz 88K /var/www/admin/data/logs/gamegods777.com.error.log.2.gz 

Maybe someone knows how to stop this filling? Maybe you can clean this information automatically, for example, every two months. Otpishi who faced similar.

  • I correctly understand that about logs and errors that are written in them - this is just a guess? And no one saw the logs themselves for 10 terabytes? - Ipatiev
  • Yes, I was advised (not on the hosting) to disable logs. I turned them off, as I wrote in the question, but it did not bear fruit. For three - four hours on hosting +100 mb. - Valery Emelyanov
  • Ah, then continue, continue. - Ipatiev
  • I supplemented the question, read - Valery Emelyanov
  • one
    If on the topic you need to look at what appeared unknown files and the size of the database, also compare the checksum of known files. will find with a 100 percent probability. but I would take the first comment since you did not wave it off. - perfect

1 answer 1

Logs are always needed:

  1. Find what takes place (easier to find with a utility like http://ashep.org/2013/analiz-ispolzovaniya-diska-pri-pomoshhi-ncdu/ )
  2. Configure logrotate correctly