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

feat: add default config values for HeadlessChromium, and a very high… #38

Merged
merged 2 commits into from
Aug 31, 2021

Conversation

mrflos
Copy link
Collaborator

@mrflos mrflos commented Apr 20, 2021

… value for page loaded timeout

Based on production problems found on https://lped.info with @furax37 , i have set higher timeouts, especially for long wiki pages that take quite a time for generation with /pdf handler.

All settings can be overriden in configuration file wakka.config.php, if necessary.

refs #44

@mrflos mrflos requested a review from thom4parisot April 20, 2021 06:28
@thom4parisot
Copy link
Member

Why are these values so high? Is it because of the machine resources, or because the pages assembly is slow?

@mrflos
Copy link
Collaborator Author

mrflos commented Apr 20, 2021

For the loading of chromium, I noticed that 30s could not be enough, even if we are using a "big" server (intel 8 cores, 32gb, soft RAID).
For the generation of page, i have no clue what's going on, but i still have timeouts with long pages, even with 120s for example here https://lped.info/?ChaskiFilDeLeau/pdf
I believe that the generation of pdf could be faster if we could send an already generated page instead of asking chromium to visit the page and wait for having it downloaded.
My idea: 1. generate the /preview view in a buffer, add some stuff for pdf rendering, open browser, send this html string to browser, generate pdf.
But i don't know if it's possible to do so.

@thom4parisot
Copy link
Member

thom4parisot commented Apr 20, 2021

Well, I'd rather investigate why it's slow, before patching these values.

http://lped.info/?ChaskiFilDeLeau/preview takes a couple of second to be ready. so any slowness related to the system should be fixed at a system level, instead of being eased/allowed by the extension (problem still here, but deeply buried, until a bigger problem arises and becomes even harder to solve).

@mrflos
Copy link
Collaborator Author

mrflos commented Apr 20, 2021

I agree, but how to check on system level?

@mrflos
Copy link
Collaborator Author

mrflos commented Apr 21, 2021

I don't know how to check it on the system, I just tried in the wiki's files folder with the current user :

sudo -u web69 time chromium --headless --no-sandbox --print-to-pdf https://lped.info/\?ChaskiFilDeLeau/preview

output :

[0421/100508.473253:WARNING:headless_browser_main_parts.cc(83)] Cannot create Pref Service with no user data dir.
[0421/100508.476227:ERROR:viz_main_impl.cc(150)] Exiting GPU process due to errors during initialization
[0421/100508.488446:WARNING:vaapi_wrapper.cc(567)] VAAPI video acceleration not available for disabled
[0421/100508.577652:ERROR:nss_util.cc(55)] Failed to create /var/www/clients/client5/web69/.pki/nssdb directory.
[0421/100513.939654:INFO:headless_shell.cc(617)] Written to file output.pdf.
0.41user 0.11system 0:05.69elapsed 9%CPU (0avgtext+0avgdata 141520maxresident)k
0inputs+8outputs (0major+17589minor)pagefaults 0swaps

So 5,69 seconds to generate this pdf output

So I don't get what is wrong on the system, I just noticed that the pdf file is blank but this is probably another problem, and i also noticed that https://lped.info/?ChaskiFilDeLeau/preview only displays one page.

@thom4parisot thom4parisot merged commit d279ae0 into master Aug 31, 2021
@thom4parisot thom4parisot deleted the longer-timeouts branch August 31, 2021 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants