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

Add cron job to docker image for graph calculations #123

Open
NotGovernor opened this issue Apr 15, 2024 · 5 comments
Open

Add cron job to docker image for graph calculations #123

NotGovernor opened this issue Apr 15, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@NotGovernor
Copy link

This is a real dead-in-the-water issue for me as I cannot shrink my site / vault. Any help would be greatly appreciated.

Describe the bug
As I added more and more files to this vault over time the initial load times have climed such that recently I've started getting the following error on the console:

[11-Apr-2024 01:26:09] NOTICE: fpm is running, pid 1
[11-Apr-2024 01:26:09] NOTICE: ready to handle connections
172.19.0.3 -  11/Apr/2024:01:26:26 +0000 "GET /index.php" 500
NOTICE: PHP message: PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/perlite/helper.php on line 478

To Reproduce
I'm not entirely sure, but it seems to be related to the quantity of files in the vault. I'm currently around 600 md's and another 600 images.

Device (please complete the following information):
Client device doesnt matter. It's a server issue. Running in docker. 2 vcpu's 4 gb ram.

@NotGovernor NotGovernor added the bug report Something isn't working label Apr 15, 2024
@NotGovernor NotGovernor changed the title PHP Fatal error: Maximum execution time of 30 seconds exceeded [BUG] PHP Fatal error: Maximum execution time of 30 seconds exceeded Apr 15, 2024
@NotGovernor
Copy link
Author

NotGovernor commented Apr 15, 2024

Might be related to the graph? I'll try deleting the metadata.json file as a temporary workaround so I can get the site back online in the meantime. It's gotten pretty big...

[edit] That worked. Site is functional again. So the pressure is off for me. :D:D Though I have only about half of the sites content up so far -- the likely size of the metadata will probably be double what it is now. (about a 1 MB file, tens of thousands of lines)

@NotGovernor
Copy link
Author

Related to issue #97 ?

@secure-77
Copy link
Owner

yes, it seems to be the same problem.
The problem is that your php enigne can't calculate the graph relations in 30 seconds. It only need to do it one time after the metadata.json has changed, after this the final html is stored in a tmp file.

So two solutions:

You only need to run this script one time after the metadata.json has changed

@NotGovernor
Copy link
Author

Thank you for the response and the python file. Might it be a good idea to remove the graph calculation from php and have a cron or something in the docker that runs the python every few minutes, processing only if the file has been modified?

@secure-77
Copy link
Owner

I don't want to remove it completely from PHP, because if you don't have to many notes and running the non docker setup you always need then to setup a cron job, which I want to avoid. But I will think about to add a cron job to the docker image.

@secure-77 secure-77 added enhancement New feature or request and removed bug report Something isn't working labels May 26, 2024
@secure-77 secure-77 changed the title [BUG] PHP Fatal error: Maximum execution time of 30 seconds exceeded Add cron job to docker image for graph calculations May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants