Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Humongous file in /tmp/climulti #6617

Closed
alexbaldo opened this issue Nov 7, 2014 · 3 comments
Closed

Humongous file in /tmp/climulti #6617

alexbaldo opened this issue Nov 7, 2014 · 3 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@alexbaldo
Copy link

Hello.

Yesterday, we lost connectivity to our stats Piwik server. When we started investigating the issue, we realized that the hard drive had literally 0MB free. We were surprised, because we have a website with moderate traffic.

Actually, with further investigation, we have seen that the database was not taking more than 80MB. The problem was that a giant file was stored in the folder /var/www/tmp/climulti. There were two files, a *.pid file and a *.output file, and the latter was taking as much as 69GB of hard drive storage. Unfortunately, as the machine was barely usable because of the lack of free space, I've not been able to compress it, send it to an external server or open it. However, I could see the first line and it seemed to be an error log, yet not similar to those of Apache Server.

I assume some kind of infinite-loop error occurred and it managed to take all the free storage in the hard drive. However, I have no idea of what could happen. Any idea?

PS: I know it is difficult to know what could happen given that I could not provide the contents of the file. If only we knew what kind of information is saved in that folder, it would be Ok.

We were using Piwik 2.8.3, the latest version up to now.

Regards!

@diosmosis
Copy link
Member

The tmp/climulti folder holds process IDs and output for php processes that Piwik launches. This is done for concurrency, so the output will be for commands like php /path/to/piwik/console climulti:request ?somepiwikquerystring which invokes a Piwik request on the command line. It's mainly used during archiving.

I assume you've setup a cron to do archiving? Can you show us the crontab entry? Can you also tell us more about the php executable you use to run archiving?

Any information about your php config & server could also be helpful.

@cybernet
Copy link
Contributor

cybernet commented Nov 8, 2014

and after this is solved maybe someone can provide a fix to not bottleneck our servers

@tsteur
Copy link
Member

tsteur commented Nov 9, 2014

To prevent such issues we could maybe add a check in Proccess::hasFinished and declare a process as finished once the file size of .pid is > 1MB and .output is > eg 100MB. The size should "usually" never exceed 1MB I think. I heard something similar maybe 4 months ago in a chat so this does not seem to be the only user having this problem.

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Nov 10, 2014
@mattab mattab added this to the Piwik 2.10.0 milestone Nov 10, 2014
@tsteur tsteur self-assigned this Nov 12, 2014
tsteur added a commit that referenced this issue Nov 13, 2014
…shed

Declares a process as finished as soon as a PID file is > 500bytes
(contains only PID) and output file is > 100MB (which should usually
not be larger than 100KB or 1MB) to prevent files growing up to many
GBs. I added unit and integration tests for the file size detection. It is
now possible to mock the methods file_exists and filesize although very
simple so far. Later we can allow to define callbacks or to define different
return values for different files or we can use something like vfsStream
@tsteur tsteur closed this as completed Nov 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

5 participants