Last modified: 2013-10-19 11:19:03 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T56060, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54060 - Use more than 1 thread per transcode
Use more than 1 thread per transcode
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
TimedMediaHandler (Other open bugs)
master
All All
: High enhancement (vote)
: ---
Assigned To: Jan Gerber
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-12 04:38 UTC by Sam Reed (reedy)
Modified: 2013-10-19 11:19 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sam Reed (reedy) 2013-09-12 04:38:18 UTC
https://commons.wikimedia.org/wiki/File:Visual_Editor_Presentation_2013.webm

41 min 45 s, 1,920 × 1,080 (936.69 MB)


For big files such as this (in size, resolution and quality), it would make sense to have more than 1 thread doing hte transcode

In this cases on the wikimedia boxes they have 16 threads (2 x 4 core + HT). Which means a lot of the box is sitting idle, meaning the transcodes take longer, rather than being sped up by using more of the available capacity
Comment 1 Jan Gerber 2013-09-16 15:37:31 UTC
problem with using multiple threads is that the memory use per encode multiplies too. whats the amount of ram available in the box, we might be able to use 2 threads per encode now, the first set of encoding boxes did not allow that.
Comment 2 Brion Vibber 2013-09-16 15:52:11 UTC
If y'all have to buy more RAM, please buy more RAM. :)

Leaving CPUs idle while transcoding a 40m-minute 1080p video makes no sense at all.
Comment 3 Sam Reed (reedy) 2013-09-16 16:14:54 UTC
reedy@tmh1001:~$ cat /proc/meminfo
MemTotal:       16419920 kB

so 16GB


See also http://ganglia.wikimedia.org/latest/?r=hour&cs=&ce=&s=by+name&c=Video%2520scalers%2520eqiad&tab=m&vn=

Looks like we're not even using half of the memory of the cluster. CPUs are mostly idle.

Should be plenty of room (slot wise) to upgrade RAM. We might even have some spare at EQIAD. I'll drop a procurement ticket and then it can go through the process.

Any suggestions what we should go for? 64GB in each?


I don't see any reason to also upgrade the PMTPA boxes at the moment.
Comment 4 Sam Reed (reedy) 2013-09-16 16:55:43 UTC
I suspect we could at least double that one to a 2. The jobs are done synchronously, right? ie one at a time (per job runner)?

In which case, we don't care so much how much memory is used at a time
Comment 5 Sam Reed (reedy) 2013-09-16 17:29:04 UTC
Thinking about it, the simplest way to fix this bug might be to just make a global. It can then be set for WMF usage as appropriate - even (number of cores - 1) if the boxes only do one at a time.

Code to count cpus or cores in php gets a little scary.

This of course still leaves the potential memory upgrade, and setting of the config as both non issues in the WMF domain
Comment 6 Jan Gerber 2013-09-17 07:57:03 UTC
right now we run 10 concurrent jobs(puppet manifests/role/applicationserver.pp) with $wgTranscodeBackgroundMemoryLimit set to 2GB thats 20GB ram. Since a lot of this is mmapped this is working out. Setting threads to 2 we will need to set $wgTranscodeBackgroundMemoryLimit to 4GB, leaving it at 10 concurrent jobs we end up with 40GB ram. Since there are not so many videos to encode in parallel we could reduce the number of concurrent jobs to 5.
Comment 7 Gerrit Notification Bot 2013-09-17 08:06:06 UTC
Change 84493 had a related patch set uploaded by J:
Make number of threads a configuration option

https://gerrit.wikimedia.org/r/84493
Comment 8 Sam Reed (reedy) 2013-09-17 16:29:20 UTC
(In reply to comment #6)
> right now we run 10 concurrent jobs(puppet
> manifests/role/applicationserver.pp)
> with $wgTranscodeBackgroundMemoryLimit set to 2GB thats 20GB ram. Since a lot
> of this is mmapped this is working out. Setting threads to 2 we will need to
> set $wgTranscodeBackgroundMemoryLimit to 4GB, leaving it at 10 concurrent
> jobs
> we end up with 40GB ram. Since there are not so many videos to encode in
> parallel we could reduce the number of concurrent jobs to 5.

That seems a more sensible option to me - fewer jobs running quicker


Any suggestion on ram amounts? Should we double it or quadruple it?
Comment 9 Gerrit Notification Bot 2013-09-17 17:05:13 UTC
Change 84539 had a related patch set uploaded by J:
Set $wgFFmpegThreads to 2 for faster transcodes

https://gerrit.wikimedia.org/r/84539
Comment 10 Gerrit Notification Bot 2013-09-18 08:42:22 UTC
Change 84493 merged by jenkins-bot:
Make number of threads a configuration option

https://gerrit.wikimedia.org/r/84493
Comment 11 Gerrit Notification Bot 2013-09-18 18:18:46 UTC
Change 84775 had a related patch set uploaded by Reedy:
Drop Video Scalers to 5 concurrent jobs

https://gerrit.wikimedia.org/r/84775
Comment 12 Gerrit Notification Bot 2013-09-18 18:38:12 UTC
Change 84775 merged by Akosiaris:
Drop Video Scalers to 5 concurrent jobs

https://gerrit.wikimedia.org/r/84775
Comment 13 Gerrit Notification Bot 2013-09-18 20:50:08 UTC
Change 84539 merged by jenkins-bot:
Set $wgFFmpegThreads to 2 for faster transcodes

https://gerrit.wikimedia.org/r/84539
Comment 14 Andre Klapper 2013-10-18 18:41:05 UTC
So is more work needed here (if so: what?) or can this be closed as RESOLVED FIXED?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links