title: How to optimize liquidsoap?
body: <p>I want to relay ~40 radio with Icecast and transcode them to 3 bitrates(32,64,128)</p>
  
  <p>Relay all radio and transcoding them to 32 bitrate working good, but on 64, 128 doesn't work</p>
  
  <p>Liquidsoap logs:</p>
  
  <pre><code>2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
  2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.04s.
  2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
  2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.02s.
  2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
  2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
  2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
  2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
  2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
  2015/07/24 11:36:56 [:3] Buffer overrun: Dropping 0.03s.
  </code></pre>
  
  <p>Liquidsoap config:</p>
  
  <pre><code>set("buffering.kind","raw")
  set("log.file", true)
  
  def my_input(url) =
      mksafe(input.http(buffer=5., max=20., url));
  end
  
  def outputs(name, mount, input) =
      output.icecast(
      %mp3(bitrate=32, samplerate=22050, stereo=false),
      ******
      mean(input))
  
      output.icecast(
      %mp3(bitrate=64,samplerate=44100,stereo=true),
      ******
      input)
  
      output.icecast(
      %mp3(bitrate=128,samplerate=44100,stereo=true),
      ******
      input)
  
  end
  
  url = "http://localhost:8000/radio1"
  input = my_input(url)
  outputs("Radio1", "radio1", input)
  
  #..............
  
  url = "http://localhost:8000/radio40"
  input = my_input(url)
  outputs("Radio40", "radio40", input)
  </code></pre>
  
  <p>Icecast limits:</p>
  
  <p><a href="https://i.stack.imgur.com/BufUZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BufUZ.png" alt="enter image description here"></a></p>
  
  <p>Server info:</p>
  
  <pre><code>6 cores(average load 40%)
  6GB RAM
  </code></pre>
  
  <p>htop screen:
  <a href="https://i.stack.imgur.com/4RPOO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4RPOO.png" alt="enter image description here"></a></p>