[9 June 2010] C-200/A-200 NMJ UI PREVIEW (under development) | 18. Jan 2010 Popcornhour C-200 Manual

Firmware Updates C-200 [26 Aug 2010] | A-200 [14 May 2010] | A-100 [13 Aug. 2010] | A-110 [18 Aug. 2010] | B-110 [23 Apr. 2010]

Just got your NMT | WIKI has the answers | Search the forum BETTER | Forum Rules/Policy | Firmware & Official NMT News


1 user browsing this thread: (0 members, and 1 guest).

Thread Closed 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Optimising memory on your PCH
02-16-2009, 04:17 PM
Post: #1
Optimising memory on your PCH
Hi All,

Since the various NMTs have very little memory available, it can be critical to free up as much of this as possible to ensure good playback rates (especially of high definition content).

To that end, there are a number of things you can do to free up memory.

Common-sense approach:

Obviously the easiest way to free up memory is to turn off the things you don't use. If (like me) you don't use your PCH for streaming across a network or connecting to network shares, then you can easily turn off various services like Casgle, NFS server, etc.

It's entirely up to you what you turn on or off but remember that if you turn off myIhome then any custom start.cgi/index.htm will fail to work unless modified!

Unix hacking approach:

First off - a warning! I'm familiar with Unix as well as optimising and configuring applications for high-load, high-traffic environments. To me this means speed but for the purposes of the NMT we are concentrating on light.

To make these optimisations you must have telnet access to your box. If you break your box I'm not responsible! Wink

Modifying the default webservers:

There are a number of webservers on the PCH. We have files in:

/opt/sybhttpd/
/mnt/syb8634/server/
/mnt/syb8634/server/php5server/

We'll be modifying each of these in term to coax some more memory out of them.

To start, edit /opt/sybhttpd/sybhttpd.conf

First we are going to drop down the max number of simultaneous users on the 8883 port. The default is 100, but it's highly unlikely we'll ever reach that number so lets halve that number (you can also drop it to 25 if you want).

Replace:
Code:
maxusers 100

With:
Code:
maxusers 50

Next, we'll reduce the number of "slots" started by default - here I've chosen a number thats fairly low, but thats becuase there aren't that many things running at the same time on that port.

Replace:
Code:
initialslots 10

With:
Code:
initialslots 3

That's it for that file. Let's move onto the next.

Next, edit /mnt/syb8634/server/httpd.conf

We'll be doing the same things here as we did to the sybhttpd.conf.

Change:

MinSpareServers 2
MaxSpareServers 5
StartServers 2
MaxClients 50
MaxRequestsPerChild 1000

We don't really need userdir support, so we can turn this off:

Find:
Code:
<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>

Replace with:
Code:
#<IfModule mod_userdir.c>
#    UserDir public_html
#</IfModule>

Note that when you do a ps listing you'll see 1 + MinSpareServers in the list. By dropping the MinSpareServers to 1 and StartServers to 1 you can save another ~2mb of memory. Very handy if you only use the PCH itself for watching things!

That's it for this file!

Next, edit /mnt/syb8634/server/php5server/httpd.conf

Change to:

MinSpareServers 2
MaxSpareServers 5
StartServers 2
MaxClients 50
MaxRequestsPerChild 1000

Note:

There are a number of other improvements that can be made here - such as moving the various php lines out of the virtualhost and into the main apache config file. If you are feeling really adventurous, you can even combine this php5server with the other one a directory below!

Also note that this server can be completely turned off if you dont use nzb or clutch (ie if you have replaced it with another version of transmission).

Other programs:

There is a process called "cdstatus" running which monitors any CD drives connected and reports information on the CDs within. If you never hook up a CD drive this process can be killed.

You also have the /mnt/syb8634/bin/btpd program running. I haven't investigated whether this can be safely killed if you use the later version of Tranmission (1.50) but I would assume so. Any information on this would be good. Smile

Final steps:

The final step is to reboot your PCH. You can do this at the telnet cli with the command "reboot".

You can use the command "free" to see how much memory is used. You can also use "top" to see current processes and how much memory they consume (as well as the obvious ps). Note that the top within the dropbear release doesn't support normal keys so you have to hit Ctrl-Z to exit, then kill the process.

Anyway, hopefully this can be useful for some people - any contributions are welcome. Let me know if you have any questions or suggestions.

Regards,
Delphy

My NMT apps / themes
Find all posts by this user
02-16-2009, 09:00 PM
Post: #2
RE: Optimising memory on your PCH
Have you found the pch to run faster or better by this approach yet.
Find all posts by this user
02-16-2009, 09:19 PM
Post: #3
RE: Optimising memory on your PCH
(02-16-2009 04:17 PM)Delphy Wrote:  Since the various NMTs have very little memory available, it can be critical to free up as much of this as possible to ensure good playback rates (especially of high definition content).

Extra memory really doesn't have anything to do with playback efficiency on this platform with the way it is currently configured. Even if processes start having pages kicked to swap, most of what the streamer task (usually mono) uses are reserved pages (dma buffers, file buffers, text pages, and memory outside of what is allocated to Linux). CPU resource contention would likely cause problems long before ram.

There is about 46 MB or half of what is earmarked for Linux (after kernel static) that is almost waisted in the form of the initrd ram disk. There might be some cleanup opportunity there just by trimming fat after boot. I wish Syabas would have done something sensible like use jffs2 Sad

(02-16-2009 04:17 PM)Delphy Wrote:  Note that the top within the dropbear release doesn't support normal keys so you have to hit Ctrl-Z to exit, then kill the process.

I've seen this problem with telnetd, but never dropbear. It's a ctrl-c problem in the termcap not any particular program.
Find all posts by this user
02-16-2009, 09:44 PM
Post: #4
RE: Optimising memory on your PCH
alanb Wrote:I've seen this problem with telnetd, but never dropbear. It's a ctrl-c problem in the termcap not any particular program.

Ahh ok thanks. sshd never works for me on my PCH (no valid authentication methods) so I always use telnetd.

I agree that trimming the fat after boot would be a good idea - it's a shame to see all that memory go to waste!

My NMT apps / themes
Find all posts by this user
02-18-2009, 05:51 PM
Post: #5
RE: Optimising memory on your PCH
there is way to create a script to clean cache, temp folder or something like that to restore space on disk

C-200
Find all posts by this user
02-18-2009, 06:07 PM
Post: #6
RE: Optimising memory on your PCH
Since you don't mention it, I guess that means you've discovered that the changes remain after a reboot.

For the sake of others, people should know that these custom changes will be lost next time they do a firmware upgrade,
or more likely or if there's a NMT apps update.
Find all posts by this user
02-18-2009, 06:19 PM
Post: #7
RE: Optimising memory on your PCH
no, i dont now how to, i only ask Rolleyes

C-200
Find all posts by this user
02-26-2009, 06:10 AM
Post: #8
RE: Optimising memory on your PCH
I was thinking about this. Im going to try this to see if it speeds up unrar. as unrar should use the linux size and not playback side of things.
Find all posts by this user
02-26-2009, 10:00 PM
Post: #9
RE: Optimising memory on your PCH
Be wary if you are running the latest firmware (as of today) - my experiments show that once you start plinking with the apache configs you *have* to reboot for them to work, else you get errors.

My NMT apps / themes
Find all posts by this user
04-12-2009, 12:04 PM
Post: #10
RE: Optimising memory on your PCH
So do these tweaks help unrar performance? And by how much?

Cheers, good work!
Find all posts by this user
04-12-2009, 02:15 PM
Post: #11
RE: Optimising memory on your PCH
interesting. Gonna follow this tread..

Popcorn Hour A-110, Yamaha RX-V661, LG 37LG5020, ELAC Dipol 5.1 set
Find all posts by this user
05-17-2009, 12:54 PM
Post: #12
RE: Optimising memory on your PCH
the modifications of file /opt/sybhttpd/sybhttpd.conf will be lost after reboot

pch a-110, 1Tb hd; chroot-debian: openssh nfsd smbd vsftpd atd
nslu2, 320Gb hd; debian: router/fw/gw dhcpd apache/ssl nfsd smbd cupsd openssh
nslu2, 2Gb usb; debian: nfs rTorrent
wl-500g(2x), 256Mb usb; openwrt: ap wds
LogitechHarmony525(2x)
Find all posts by this user
05-17-2009, 03:59 PM
Post: #13
RE: Optimising memory on your PCH
newbie question: how and where do i edit these files? Love to learn stuff!

Popcorn Hour A-110, Yamaha RX-V661, LG 37LG5020, ELAC Dipol 5.1 set
Find all posts by this user
05-18-2009, 09:32 AM
Post: #14
RE: Optimising memory on your PCH
(05-17-2009 03:59 PM)Funksoldier Wrote:  newbie question: how and where do i edit these files? Love to learn stuff!

first install telnet and/or dropbear then edit those files with "vi"
or simply do:
http://www.networkedmediatank.com/wiki/i...i_Commands

pch a-110, 1Tb hd; chroot-debian: openssh nfsd smbd vsftpd atd
nslu2, 320Gb hd; debian: router/fw/gw dhcpd apache/ssl nfsd smbd cupsd openssh
nslu2, 2Gb usb; debian: nfs rTorrent
wl-500g(2x), 256Mb usb; openwrt: ap wds
LogitechHarmony525(2x)
Find all posts by this user
05-21-2009, 04:19 PM
Post: #15
RE: Optimising memory on your PCH
Is there any way to expand cache memory allocation so that most of the problems is solved?

«» Popcorn A-110, WD 1TB, CAT 5 LAN «» Onkyo HTS-670 «» Samsung 46" LCD «»
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  NZBGet on the PCH/NMT Manual and F.A.Q. Philos 124 113,901 Today 12:31 PM
Last Post: MacLeod
  Playing music with Winamp from PC to PCH alvoryx 30 12,261 07-31-2010 08:46 AM
Last Post: Skanda007
  How-to: Install and Configure Dropbear on the PCH racanu 60 44,822 11-26-2009 10:05 PM
Last Post: sp0
  Web browser access to the PCH from your PC cheaper_popcorn 67 88,437 10-02-2009 12:31 PM
Last Post: gretrick
Game Tutorial: How to use the Xbox360 to play files off the PCH? victorakkersdijk 0 2,290 08-01-2009 10:04 PM
Last Post: victorakkersdijk
Thumbsup How-To: Convert Apple HD Trailers to PCH friendly luckyy 2 2,360 07-11-2009 05:32 AM
Last Post: BuddyBoy
  What can the PCH do for me - Popcornhour FAQ Philos 38 80,673 05-25-2009 12:46 AM
Last Post: landoncube
  [DOC] UPnP PCH-A100 Media Server A/V controlled by Nokia N95 8GB Kasimodo 7 10,866 04-21-2009 10:39 PM
Last Post: javierPopCorn
  HowTo Setup Harmony Remote for use with PCH-A100 journey4712 62 34,557 04-20-2009 08:34 PM
Last Post: woutersa
  success: mlb.tv playing off the PCH! (in ubuntu) eliotw 1 5,648 04-05-2009 07:33 PM
Last Post: tracerhand

Forum Jump: