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

Multithreading Support #434

Open
cmdrkarl opened this issue Dec 2, 2023 · 3 comments
Open

Multithreading Support #434

cmdrkarl opened this issue Dec 2, 2023 · 3 comments

Comments

@cmdrkarl
Copy link

cmdrkarl commented Dec 2, 2023

Hello,

can multithreading be added to use modern CPUs?

Thanks,
Kurt

@MrRinkana
Copy link

This would be really nice, first time generating previews on an instance with a decent amount of media is pain, it took on my instance the about 24h on a i7 3770k..

All that is needed is to start multiple preview generations simultaneously set by a command line option such that some cores can be left for serving nextcloud.. I'm not sure how it works when executed trough php but ffmpeg supports multithreading per default, so one could keep a single queue but generate each image a lot faster instead..

This would also help when a lot of images are being uploaded at the same time, as currently its possible on my instance to upload a lot faster than the preview generation keeps up..

@MrRinkana
Copy link

I suspect this will be left as h2non/imaginary is being recommended instead of this app - and in that setup multithreading will be used!

@iamdoubz
Copy link

iamdoubz commented Apr 4, 2024

What would happen if you ran this command:

bash -c 'for i in {1..4}; do (occ preview:pre-generate -vvv &); done'

Is this a hack? Or, would it destroy my system? From what I gather, it would spawn 4 different instances of pre-generate at the same time... is this okay/allowed?

Update

So I just went ahead and tested with one folder. It spawned 4 instances and they all scanned the same file... not what we want... But, my library is organized by Year and Month, so I changed it to:

sudo htop
bash -c 'for i in {1..4}; do (occ preview:pre-generate -vvv --path="/username/files/Photos/2024/0$i" &); done'

Because of how the second command is run, you cannot input the sudo password, so you have to sudo something first before running the command... I choose sudo htop. What the second command did is that it spawned four processes looking in my Photos directory, year 2024, then the $i corresponds to what month I want... Not "multithreading" but does make scanning four times faster in this example...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants