Re: [SlimDevices: Unix] Speeding up web interface in Ubuntu
adamslim wrote: I would like to speed up the web interface and database queries, and wondered if moving some files to a ramdisk would help. (The machine is quite fast - Core2Duo, 4GB RAM, used only as a server and on 24/7). RAMdisk is rarely useful on modern OS, such as Ubuntu 9.10. Using one requires that you manually decide what files need to be in memory, and you make the general memory available smaller. Its nearly always better to let the operating system do the management. Again, clear instructions on how would be nice :) Its not clear what you think of as slow and what would need speeding up. Before you change anything, you should try to define what is slow and why, so you can make meaningful changes. How many albums do you have? how many songs? What do you think is slow? What formats? are you using iTunes? I've been running my SBS on a Debian server for ages (Debian is the father of Ubuntu). Its plenty fine for me. Sure, scanning takes a while, but I don't do it very often, so I don't care. The web UI is fast, as is the response on my Controller and my Touch. There is really no speed associated with playing music to a player, be it Classic, Transporter, Boom, etc. Rarely is the speed of the server an issue when you are streaming bits. -- Pat Farrell http://www.pfarrell.com/ ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Speeding up web interface in Ubuntu
A ramdisk can make things move along; there is a user here that does that... try search. Otherwise, if you are using the mysql that comes with SBS, you can use better settings for mysql; see http://forums.slimdevices.com/showthread.php?t=60682 In post 18 you find a configuration file that can be used. It will improve things somewhat but the webinterface are still a snail. Things to come in 7.6: - the re-introduction of SQLite improves e.g. scanning 2-3 times - SQLite is also used for artwork handling. This is part of the scanning improvement, but it also improves responsiveness slightly. But so far the webinterface is a bit still sluggish. But it is the best that I have seen it in the 7.xx SBS series. If you own a iPhone/Touch, android or windows mobile phone; you have alternatives that often are better than the controller. -- slate Main: Duet - Beresford Caiman - Carver A-500x - BW 704 Office: Duet - Technics SU-V50 - Stax SR84 Pro Server: Zotac IONITX-A, 4 GB, 1 TB WD EADS, Win7 w. 7.5e slate's Profile: http://forums.slimdevices.com/member.php?userid=30502 View this thread: http://forums.slimdevices.com/showthread.php?t=77140 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Speeding up web interface in Ubuntu
adamslim wrote: It's just the web interface, and especially when I'm doing more complex stuff with custom browse. Some of the database queries can take over 20-30s, and since I would like to run several queries (for example, first to get piano music, then instrumental rather than orchestral), it makes the whole browsing system less of a joy than it should be. 30 seconds per thing is way too slow for happy users. I have not looked at the way SBS talks to MySql recently (i.e. not in years). But in my 30+ years of optimizing systems using DBMS, the rules are nearly always the same. 1) create proper index structures so that you don't have to do table scans. 2) don't do four, five, or eight way joins. Sure, they are handy, but they don't scale and are always too slow. If you are doing a lot of custom browsing that does a lot of sql queries, I'd start there. While my collection is less than half the size of yours, ~800 artists, 10,000 songs, the DB is tiny. only about 220K I know that MySql will attempt to cache tables into memory, and with a 4GB machine, it all should be in memory all the time. -- Pat Farrell http://www.pfarrell.com/ ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Speeding up web interface in Ubuntu
slate;532992 Wrote: Otherwise, if you are using the mysql that comes with SBS, you can use better settings for mysql; see http://forums.slimdevices.com/showthread.php?t=60682 In post 18 you find a configuration file that can be used. Cool, that helps. More complex queries are much quicker, especially when going to page 2 or running a similar query. slate;532992 Wrote: If you own a iPhone/Touch, android or windows mobile phone; you have alternatives that often are better than the controller. Yes for most browsing the iPod Touch is much faster - the cache of the albums is very good, and is the fastest handheld method, I find. I'll check if more complex browsing now works reasonably on any of the handhelds tomorrow. -- adamslim You can't have too much music, but I do have too much hifi Rock/Excalibur/MC30S, Linn Akurate Skweezy DS, Audion Pre, 6B4G SET, Lowther monsters Duet, Caiman, Audio Innovations Series 500, One Thing Quad ESLs Boom x 2, Radio adamslim's Profile: http://forums.slimdevices.com/member.php?userid=7355 View this thread: http://forums.slimdevices.com/showthread.php?t=77140 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Speeding up web interface in Ubuntu
yeah the default values for the SBS provided mysql are a bit spartan as it have to fit the lowest determinator : a NAS. Time will tell how SQLite will perform with complex queries but at least one can switch to mysql if needed. -- slate Main: Duet - Beresford Caiman - Carver A-500x - BW 704 Office: Duet - Technics SU-V50 - Stax SR84 Pro Server: Zotac IONITX-A, 4 GB, 1 TB WD EADS, Win7 w. 7.5e slate's Profile: http://forums.slimdevices.com/member.php?userid=30502 View this thread: http://forums.slimdevices.com/showthread.php?t=77140 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Speeding up web interface in Ubuntu
Moving things into a ram disk will not help database queries take less time. The way Linux works is to copy any disk data into ram for use, and then keep it there until the system is out of memory for new data. This is called page cache Here is an example of the free command output on my machine (in megabytes) Code: $ free -m total used free sharedbuffers cached Mem: 5984 5932 52 0775 3524 -/+ buffers/cache: 1633 4351 Swap: 4141 32 4108 As you can see, I have about 6GB of ram, and most of that is in use since my machine has been up for a reasonable amount of time. But if you look at the second row, you see that only 1.6GB of ram is used by applications (mostly firefox, bleh) 4.3GB of my ram is in use for page cache. The entire mysql database is only 74MB. Code: # ls -lh /var/lib/squeezeboxserver/cache/MySQL/ibdata1 -rw-rw 1 squeezeboxserver nogroup 74M 2010-04-10 17:20 /var/lib/squeezeboxserver/cache/MySQL/ibdata1 It takes no time at all for my system to read the entire contents of this file into memory: Code: # time cat /var/lib/squeezeboxserver/cache/MySQL/ibdata1 /dev/null real 0m1.270s user 0m0.000s sys 0m0.000s And then if I do the same thing again, the data is already in ram, and reads in a tiny fraction of the time. Code: # time cat /var/lib/squeezeboxserver/cache/MySQL/ibdata1 /dev/null real 0m0.085s user 0m0.000s sys 0m0.060s That's less than 1/10th of a second to scan all 75MB of mysql data. The only way for queries to take a very long time is to be doing something very wrong. Either poorly indexed queries, or very very complex queries that are eating CPU time to re-scan all the data hundreds of times over for any request. -- SuperQ SuperQ's Profile: http://forums.slimdevices.com/member.php?userid=2139 View this thread: http://forums.slimdevices.com/showthread.php?t=77140 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix
Re: [SlimDevices: Unix] Speeding up web interface in Ubuntu
I probably should have included more information about my setup: Total Tracks: 12,660 Total Albums: 1,022 Total Artists: 465 Total Genres: 1,794 AMD Athlon(tm) 64 X2 Dual Core Processor 5000+ squeezeboxserver 7.5.0 Ubuntu 9.10 (64bit) -- SuperQ SuperQ's Profile: http://forums.slimdevices.com/member.php?userid=2139 View this thread: http://forums.slimdevices.com/showthread.php?t=77140 ___ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix