1 user browsing this thread: (0 members, and 1 guest).
|
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! ![]() 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 100With: Code: maxusers 50Next, 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 10With: Code: initialslots 3That'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>Replace with: Code: #<IfModule mod_userdir.c>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. ![]() 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 |
|||
|
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.
|
|||
|
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 ![]() (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. |
|||
|
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 |
|||
|
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 |
|||
|
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. |
|||
|
02-18-2009, 06:19 PM
Post: #7
|
|||
|
|||
|
RE: Optimising memory on your PCH
no, i dont now how to, i only ask
C-200 |
|||
|
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.
|
|||
|
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 |
|||
|
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! |
|||
|
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 |
|||
|
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) |
|||
|
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 |
|||
|
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) |
|||
|
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 «» |
|||
|
« Next Oldest | Next Newest »
|

NMT Wiki
Search
Member List
Help
[9 June 2010] C-200/A-200 NMJ UI PREVIEW (under development)











