statamic / ssg

The official Statamic Static Site Generator
229 stars 23 forks source link

Redis & Fork = no SSG #61

Open jeremyvienney opened 3 years ago

jeremyvienney commented 3 years ago

Hello guys !

In an attempt to polish my Statamic stack with better performances, I enabled redis for storing the stache and added the Spatie/fork package and start testing the generation with 4 workers.

Since I could not generate correctly my static files. It close everytime like this : image

With a lot of this kind of errors in the way (I have around 600 files to generate) : image

However, if I switch redis for "file" driver, everything works, even with multiple workers, I could then generate all my website in a minute :)

I tried to not use any worker but I had same exceptions. I had to completely remove the fork package in order to work. So for resume : Redis && Fork = SSG KO Redis without Fork = SSG OK File driver && Fork = SSG OK

Here is my details environments :

Statamic 3.1.17 Pro
Laravel 8.42.1
PHP 8.0.5
aryehraber/statamic-logbook 2.0.2
doublethreedigital/duplicator 1.3.2
rias/statamic-position-fieldtype 2.0.1
statamic/ssg 0.6.0
riasvdv commented 2 years ago

SSG probably needs to reconnect to Redis to have this work, an example with MySQL is provided in the Fork docs https://github.com/spatie/fork#using-before-and-after-in-the-child-task