Plex server goes wild, consumes all memory then stops (database corruption?)

I am running WebTools. I see the plug-in in the process list.

ps -o%mem,pid,cmd --sort %mem -uplex
%MEM   PID CMD
 0.0 24052 /volume1/@appstore/Plex Media Server/Plex Tuner Service /volume1/@appstore/Plex Media Server/Resources/Tuner/Private /volume1/@appstore/Plex Media Server/Resources/Tuner/Shared 1.24.1.4931-1a38e63c6 32600
 0.5 23855 Plex Plug-in [com.plexapp.system] /volume1/@appstore/Plex Media Server/Resources/Plug-ins-1a38e63c6/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.24.1.4931-1a38e63c6 /volume1/@appstore/Plex Media Server/Resources/Plug-ins-1a38e63c6/System.bundle
 0.5 24045 Plex Plug-in [com.plexapp.plugins.WebTools] /volume1/@appstore/Plex Media Server/Resources/Plug-ins-1a38e63c6/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.24.1.4931-1a38e63c6 /volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/WebTools.bundle
 0.7 23716 /var/packages/Plex Media Server/target/Plex Media Server

(note memory% is now 0.7 after I restarted the Plex Media Server.)

I’m thinking of setting up a nightly task which runs a command to restart the Plex Media Server, if %memory rises above 10%

[ `ps -o%mem --sort %mem -uplex | tail -1 | cut -d\  -f2 | cut -d. -f1` -gt 10 ] && synoservice --restart 'pkgctl-Plex Media Server'

@iSAWaUFO1

you might want to take that up a bit higher because of the butler tasks which run.

Also, if you’re going to do that, I would log

  1. date/time of restart
  2. ps -ef | grep Plex

so we can see what’s running at that instant.

OK I’ll set up a nightly check that restarts if consuming more that 20% of the RAM, first logging data/time and ‘Plex’ processes.

if [ `ps -o%mem --sort %mem -uplex | tail -1 | cut -d\  -f2 | cut -d. -f1` -gt 20 ]         
then
  date >> ~plex/restarts.log 
  ps -ef | grep -i plex >> ~plex/restarts.log 
  synoservice --restart 'pkgctl-Plex Media Server'
fi

It might take a week before it grows to consuming that much RAM.

@iSAWaUFO1

you might NOT want to put that in ~plex

  1. DSM 7 doesn’t use it.
  2. Home directory is going to end up in / and fill it up if not careful.
  3. How about logging to the old Plex shared folder ?

It’s not so much that my Plex server “Goes Crazy!” but rather my whole Synology NAS (8GB RAM) slows down and file operations take longer to complete.
My memory usage is behaving itself right now, with the WebTools plugin consuming the most, at 1.8% of RAM, and the ‘Plex Media Server’ at only 0.8% of RAM. The latter has grown to over 30% when things bog down. (Seemingly unrelated, but yesterday I noticed my internet speeds had really bogged down and I had to reboot a router that both my NAS and computer are connected to.)

:/volume1/Plex$ ps -o%mem,pid,cmd --sort %mem -uplex | cat
%MEM   PID CMD
 0.0 24052 /volume1/@appstore/Plex Media Server/Plex Tuner Service /volume1/@appstore/Plex Media Server/Resources/Tuner/Private /volume1/@appstore/Plex Media Server/Resources/Tuner/Shared 1.24.1.4931-1a38e63c6 32600
 0.3 12213 /volume1/@appstore/Plex Media Server/Plex Transcoder -codec:#0x01 hevc -codec:#0x02 aac -noaccurate_seek -analyzeduration 20000000 -probesize 20000000 -i /volume1/MA/Plex/Movies/720p/Jean de Florette - Manon of the Spring/Manon of the Spring (1986)/Manon of the Spring (1986) - 720p[fr;En]hev.mp4 -map 0:#0x01 -codec:0 copy -filter_complex [0:#0x02] aresample=async=1:ocl='5.1':rematrix_maxval=0.000000dB:osr=48000[0] -map [0] -metadata:s:1 language=fra -codec:1 ac3 -b:1 640k -map 0:#0x03 -metadata:s:2 language=eng -codec:2 subrip -f segment -segment_format matroska -segment_format_options live=1 -segment_time 1 -segment_header_filename header -segment_start_number 0 -segment_list http://127.0.0.1:32400/video/:/transcode/session/e5ebfee3-0879-49c9-9162-eb1ed44aac79-1/a7fe3bf9-84a1-4b16-a892-a125fa60903a/manifest?X-Plex-Http-Pipeline=infinite -segment_list_type csv -segment_list_unfinished 1 -segment_list_size 5 -segment_list_separate_stream_times 1 -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 chunk-%05d -start_at_zero -copyts -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://127.0.0.1:32400/video/:/transcode/session/e5ebfee3-0879-49c9-9162-eb1ed44aac79-1/a7fe3bf9-84a1-4b16-a892-a125fa60903a/progress
 0.4 24045 Plex Plug-in [com.plexapp.plugins.WebTools] /volume1/@appstore/Plex Media Server/Resources/Plug-ins-1a38e63c6/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.24.1.4931-1a38e63c6 /volume1/Plex/Library/Application Support/Plex Media Server/Plug-ins/WebTools.bundle
 0.8 23716 /var/packages/Plex Media Server/target/Plex Media Server
 1.8 23855 Plex Plug-in [com.plexapp.system] /volume1/@appstore/Plex Media Server/Resources/Plug-ins-1a38e63c6/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.24.1.4931-1a38e63c6 /volume1/@appstore/Plex Media Server/Resources/Plug-ins-1a38e63c6/System.bundle

I’m interested to see what happens over the weekend, when a few friends and family may hit my server with requests. Almost all my F&Fs direct play/stream with basically no transcoding occuring.

Here are some folder sizes for me.
29GB /volume1/Plex

229M /volume1/@appstore/Plex Media Server/
668K CrashUploader
264K Plex Commercial Skipper
2.5M Plex DLNA Server
112K Plex Media Fingerprinter
3.7M Plex Media Scanner
18M Plex Media Server
636K Plex Relay
12K Plex SQLite
12K Plex Script Host
296K Plex Transcoder
2.5M Plex Tuner Service
96M Resources
84K dsm_config
106M lib
4.0K plex_library_path

For reference, /volume1/@appstore is the fixed package binaries (the actual software). Nothing changes in there except when you change versions.

To avoid confusion, it’s probably best to ignore it and just look at the contents of /volume1/Plex

@iSAWaUFO1 , what size is your database? Has it been growing a lot lately?

On my system (DMS7 and with latest server version) my database is located here:

Wizard Jupiter:pwd
/volume1/PlexMediaServer/AppData/Plex Media Server/Plug-in Support/Databases
Wizard Jupiter:ll -h
total 14G
drwx------+ 1 PlexMediaServer PlexMediaServer 1.2K Sep  9 11:55 ./
drwx------+ 1 PlexMediaServer PlexMediaServer  100 Jul 22  2020 ../
-rw-rw-r--  1 PlexMediaServer PlexMediaServer 2.3G Sep  9 11:29 com.plexapp.plugins.library.blobs.db
-rwx------+ 1 PlexMediaServer PlexMediaServer 2.2G Aug 31 00:07 com.plexapp.plugins.library.blobs.db-2021-08-31*
-rwx------+ 1 PlexMediaServer PlexMediaServer 2.3G Sep  3 00:06 com.plexapp.plugins.library.blobs.db-2021-09-03*
-rwx------+ 1 PlexMediaServer PlexMediaServer 2.3G Sep  6 00:03 com.plexapp.plugins.library.blobs.db-2021-09-06*
-rwx------+ 1 PlexMediaServer PlexMediaServer 2.3G Sep  9 00:08 com.plexapp.plugins.library.blobs.db-2021-09-09*
-rw-rw-r--  1 PlexMediaServer PlexMediaServer  32K Sep 10 16:05 com.plexapp.plugins.library.blobs.db-shm
-rw-rw-r--  1 PlexMediaServer PlexMediaServer 232K Sep 10 16:05 com.plexapp.plugins.library.blobs.db-wal
-rw-rw-r--  1 PlexMediaServer PlexMediaServer 409M Sep 10 17:03 com.plexapp.plugins.library.db
-rwx------+ 1 PlexMediaServer PlexMediaServer 383M Aug 31 00:03 com.plexapp.plugins.library.db-2021-08-31*
-rwx------+ 1 PlexMediaServer PlexMediaServer 387M Sep  3 00:03 com.plexapp.plugins.library.db-2021-09-03*
-rwx------+ 1 PlexMediaServer PlexMediaServer 402M Sep  6 00:01 com.plexapp.plugins.library.db-2021-09-06*
-rwx------+ 1 PlexMediaServer PlexMediaServer 412M Sep  9 00:06 com.plexapp.plugins.library.db-2021-09-09*
-rw-rw-r--  1 PlexMediaServer PlexMediaServer  96K Sep 10 17:23 com.plexapp.plugins.library.db-shm
-rw-rw-r--  1 PlexMediaServer PlexMediaServer 8.5M Sep 10 17:23 com.plexapp.plugins.library.db-wal
Wizard Jupiter:

You might need to search for where yours is but it should be in a Databases directory under Plugin Support.

I updated to Plex Server version 1.24.2.4973 and ran for ~ 9 days, until a power outage shut down my Synology NAS. The Plex Media Server seemed to behave itself, only getting up to 1.0% of RAM and 211mb virtual memory.

I will install version 1.24.3.5033 and continue observing.

I’ve updated a couple times, now running server 1.24.4.5081, and I have not noticed the problem recently. I’m hoping it’s fixed.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.