Skip to content

Conversation

@nachoparker
Copy link
Owner

@nachoparker nachoparker commented Jun 28, 2019

Motivation and goals

See nachoparker/server#1

Changes

This PR is a PoC which allows multiple concurrent executions of the preview generator in order to speed up the process by using more cores.

Ideally we would use a PHP native method for creating theads but this does not have good distribution support yet (see next section).

Results

See nachoparker/server#1 for details

Method Processes Threads Interpolate JPEG quality Time % of initial
GD 1 1 yes 60 1m50 -
GD 4 1 yes 60 28s 25%
Imagick 4 1 no 90 23s 20%
Imagick 4 1 no 60 22s 20%
GD 16 1 yes 60 12s 11%
Imagick 16 1 no 90 10s 9%
Imagick 16 1 no 60 10s 9%

Future work

  • Study generating the images in the upload hook with multiple threads so we don't need the preview generator cron job.
  • Modify Preview Generator to spawn multiple threads using pthreads or parallel once there are ZTS PHP packages available (link link) instead of relying on an external script that launches several processes in parallel.

Signed-off-by: nachoparker [email protected]

@nachoparker
Copy link
Owner Author

Sent it for review

nextcloud#166

I'll block comments here since any conversation should happen in the official repo

Repository owner locked and limited conversation to collaborators Jul 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants