Guide: Increasing Subsonic Memory Limit

Tutorials, tips and tricks.

Moderator: moderators

Postby alphawave7 » Sat Apr 16, 2011 6:59 pm

LOL! Thanks Kirk! :D
alphawave7
 
Posts: 1015
Joined: Thu Feb 11, 2010 9:54 am

Re: Guide: Increasing Subsonic Memory Limit

Postby mbro » Sat Dec 06, 2014 2:19 am

Ok, I'm still seeing an issue. Subsonic 5.0, Ubuntu and Java 1.7, 2GB of RAM. My configuration is as such:

root@bonusroom:/etc/default# cat subsonic
#
# This is the configuration file for the Subsonic service
# (/etc/init.d/subsonic)
#
# To change the startup parameters of Subsonic, modify
# the SUBSONIC_ARGS variable below.
#
# Type "subsonic --help" on the command line to read an
# explanation of the different options.
#
# For example, to specify that Subsonic should use port 80 (for http)
# and 443 (for https), and use a Java memory heap size of 200 MB, use
# the following:
#
# SUBSONIC_ARGS="--port=80 --https-port=443 --max-memory=200"

SUBSONIC_ARGS="--max-memory=700"
#was 150

# The user which should run the Subsonic process. Default "root".
# Note that non-root users are by default not allowed to use ports
# below 1024. Also make sure to grant the user write permissions in
# the music directories, otherwise changing album art and tags will fail.

SUBSONIC_USER=root
root@bonusroom:/etc/default#


root@bonusroom:/usr/share/subsonic# cat subsonic.sh
#!/bin/sh

###################################################################################
# Shell script for starting Subsonic. See http://subsonic.org.
#
# Author: Sindre Mehus
###################################################################################

SUBSONIC_HOME=/var/subsonic
SUBSONIC_HOST=0.0.0.0
SUBSONIC_PORT=4040
SUBSONIC_HTTPS_PORT=0
SUBSONIC_CONTEXT_PATH=/
SUBSONIC_MAX_MEMORY=500
#SUBSONIC_MAX_MEMORY=150
SUBSONIC_PIDFILE=
...

When I'm using the web interface and click on Settings -> clean-up database, I receive the following:

Exception org.springframework.dao.TransientDataAccessResourceException
Message PreparedStatementCallback; SQL [select max(id) from album where not present]; out of memory; nested exception is java.sql.SQLException: out of memory
Java version Oracle Corporation 1.7.0_51
Operating system Linux 3.2.0-4-686-pae
Server jetty-6.1.x
Memory Used 40 of 189 MB

Doesn't seem like its out of memory. Despite my settings above, it only shows 189MB of memory being allocated. How come? Do I need to adjust another file?


*** Edit ***

I think my issue was sorted out by deleting the /var/subsonic/db and /var/subsonic/jetty directories contents and rebuilding the database. I don't entirely understand what was going on in the DB, but deleting the DB and running the media scan again succeeded....
mbro
 
Posts: 16
Joined: Fri Mar 30, 2012 9:59 pm

Re: Guide: Increasing Subsonic Memory Limit

Postby lovebags » Tue Jan 27, 2015 10:11 am

I've been running our installation at 2GB of memory for the last year and has handled well with over 1000 users and 500,000 hits. Prior to that the system would lock up under heavy load.
User avatar
lovebags
 
Posts: 84
Joined: Wed Feb 02, 2011 1:49 am

Re: Guide: Increasing Subsonic Memory Limit

Postby Sherwino » Mon May 02, 2016 3:39 pm

lovebags wrote:I've been running our installation at 2GB of memory for the last year and has handled well with over 1000 users and 500,000 hits. Prior to that the system would lock up under heavy load.


Whoa, can you tell me a little bit more about your setup?

It could be via PM don't want to derail the guide.
Just curious what you have to do to prepare for such traffic.
Recently got a VPS, figuring out how to allocate the right resources.
Sherwino
 
Posts: 3
Joined: Mon May 02, 2016 3:10 pm

Re: Guide: Increasing Subsonic Memory Limit

Postby chasmo » Sun Oct 30, 2016 6:01 pm

A note on this - I've found that even with a very large collection, setting the memory limit too high actually slows down the interface. I was using 512, and when I dropped to 256, everything improved greatly. I have no idea why that would be - I have plenty of RAM available.

I should add that I don't have a high user load, usually only me or my wife at work or on the road via AVSub.
chasmo
 
Posts: 26
Joined: Sat Jan 19, 2013 7:08 pm

Re: Guide: Increasing Subsonic Memory Limit

Postby herri » Thu Jul 13, 2017 9:16 pm

Very helpful tutorial! I will definitely try it. Right - sometimes Subsonic freezes and I think that increasing the memory limit will help to solve this problem.
herri
 
Posts: 2
Joined: Thu Jul 13, 2017 9:05 pm

Previous

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 3 guests