View previous topic :: View next topic |
Author |
Message |
bernied n00b
Joined: 03 Apr 2006 Posts: 50 Location: UK
|
Posted: Fri Dec 15, 2006 12:34 pm Post subject: [solved] mysql on a slug - is this a bad idea? |
|
|
I'm running gentoo on a LinkSys NSLU-2 (slug), using the armeb-softfloat-linux-uclibc stage 3. I'd like to get torrentflux, which is a php web frontend for bittorrent, but it needs mysql among other things (like Apache).
So, is installing mysql on a 266MHz, 32M ram machine, a bad idea? Likewise for Apache? I only ask because mysql has taken over 12 hours compiling time so far, and doesn't look like it's going to finish any time soon. And then there is Apache to install, and the php module for it. All dependencies seem to be available (ie. not masked, like a lot of the stuff I've tried), so there are no *obvious* (to me anyway) difficulties ahead.
Does this stuff run well on low-spec machines? Or will it run the CPU at 100% 24/7 and cook the poor little beast into an early grave?
I've been running bittorrent-curses in screen, and accessing it through ssh, and each instance of bittorrent uses about 10% CPU when steaming along, so couldn't be happier with that, but I want something a bit more accessible for the less technnically-minded on the network. Is there a lighter way to have the pretty interface?
Last edited by bernied on Thu Dec 21, 2006 10:04 pm; edited 1 time in total |
|
Back to top |
|
|
zeonglow n00b
Joined: 11 Sep 2006 Posts: 51 Location: /dev/zero
|
Posted: Fri Dec 15, 2006 9:55 pm Post subject: |
|
|
You could try cross-compliling on a newer machine and then copying the binaries, might save you some time! You'd better check the mysql web site to see if the ram is sufficent. |
|
Back to top |
|
|
bernied n00b
Joined: 03 Apr 2006 Posts: 50 Location: UK
|
Posted: Mon Dec 18, 2006 12:01 pm Post subject: |
|
|
If anyone is following this, the mysql website doesn't seem to have any minimum RAM requirements, but does suggest that each instance of mysql will use about 100M of RAM, which doesn't sound good for a 32M machine, hmmmm?
I interrupted the build twice, once because it just seemed too slow (over 48 hours for one package?), and once because I thought the machine had hung. What seems to be happening is that the 32M ram is nowhere near enough for the compiling, and in top what I see is usb-storage and kswapd0 both very busy, cc1plus using all the memory, and around 65% of cpu time is waiting (that is what 'wa' means, right?). So it's swapping madly and only compiling at maybe 10% of cpu time, which is pretty slow on a 266MHz machine. I will give it a few days this time and see what happens.
Apache is running ok though. Only mysql and mod-php to add to get torrentflux going. The torrentflux docs suggest that another database solution might be used, but the details are hazy, so I'm still going to try this.
EDIT: just had a look at the ipkg lists for uNSLUng (my other slug runs on this), and they do include mysql, apache, apache-php, which is encouraging. |
|
Back to top |
|
|
tokka Tux's lil' helper
Joined: 11 Sep 2004 Posts: 99
|
Posted: Mon Dec 18, 2006 2:15 pm Post subject: |
|
|
bernied wrote: | and they do include mysql, apache, apache-php, which is encouraging. |
Yup, I've used their mysql package on a slug, and it worked well as a standalone db, as does apache work well serving static files - not sure I'd want a dynamic LAMP website running on a slug though...
|
|
Back to top |
|
|
bernied n00b
Joined: 03 Apr 2006 Posts: 50 Location: UK
|
Posted: Wed Dec 20, 2006 1:38 am Post subject: |
|
|
It almost works. All the components work on the uNSLUng machine, but when I try to do stuff with the php scripts (like running torrentflux), apache hangs - I can't reach the webserver at all until I restart it, and no error messages. Most of the httpd processes reported in top (atop on this machine) disappear and those remaining need kill -9 to die. A simple php script (the old phpinfo) works fine.
mysql has finished building on the gentoo box, emerging php now.
I think it might all be a bit of wasted effort though - not optimistic that this lot will fly. |
|
Back to top |
|
|
bernied n00b
Joined: 03 Apr 2006 Posts: 50 Location: UK
|
Posted: Thu Dec 21, 2006 10:03 pm Post subject: |
|
|
Well, I'm mightily impressed - the slug is badly named, unless there is a flying slug.
So, using gentoo it all works very well - I now I have a fanless, web-based bittorrent server running.
Torrentflux is very attractive and seems quite sensible/friendly/intuitive etc (all the good things a GUI should be). The bittorrent client runs in python, the web-side is php and it uses mysql to keep its data.
Total CPU usage varies, but for one torrent (which is about all I ever have going at a time), it's about 20-35% when the web interface isn't running, another 10% or so when it's being watched. There's a lot of memory-hungry stuff involved (mysql, apache2, python), and it's using about 40M of swap on top of the 32M of RAM. This seriously makes me want to 'fatten' this slug (doubling RAM to 64M - involves soldering - ouch!)
[EDIT: CPU usage is more like 5-25%, once it settles down, but this torrent is not very fast - 10K or so]
Here's some example output from top - any suggestions on how to reduce overhead (memory and cpu) appreciated - this is inside a firewall and I don't plan to open the web server to the big wide world, so security not a huge factor (I am running it all under a user that cannot do anything else though)...
this output is from when I am using the web front-end, so it's a bit busier than when I'm not watching:
Code: | top - 23:13:34 up 5 days, 2:45, 4 users, load average: 1.26, 1.42, 1.53
Tasks: 66 total, 1 running, 65 sleeping, 0 stopped, 0 zombie
Cpu(s): 13.9% us, 2.3% sy, 0.0% ni, 79.7% id, 1.0% wa, 2.9% hi, 0.3% si
Mem: 30300k total, 29344k used, 956k free, 268k buffers
Swap: 522104k total, 44804k used, 477300k free, 6564k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1239 apache 15 0 12740 5608 692 S 14.2 18.5 9:01.04 python
1254 apache 16 0 12740 5608 692 S 0.0 18.5 0:00.04 python
915 apache 16 0 12068 5248 1940 S 0.0 17.3 0:15.56 apache2
911 apache 16 0 11560 3204 1468 S 0.0 10.6 0:21.28 apache2
913 apache 16 0 11868 3172 1624 S 0.0 10.5 0:15.81 apache2
938 apache 16 0 12076 2472 1484 S 0.0 8.2 0:18.60 apache2
914 apache 16 0 11864 1924 1328 S 0.0 6.3 0:15.29 apache2
1076 mysql 16 0 23824 1924 1460 S 0.0 6.3 0:00.11 mysqld
1061 mysql 16 0 23824 1924 1460 S 0.0 6.3 0:00.64 mysqld
1077 mysql 15 0 23824 1924 1460 S 0.0 6.3 0:00.24 mysqld
2228 root 16 0 4724 1588 492 S 0.0 5.2 15:56.60 ddclient
912 apache 16 0 11868 1552 1284 S 0.0 5.1 0:15.86 apache2
937 apache 16 0 11556 1520 1280 S 0.0 5.0 0:13.41 apache2
939 apache 16 0 11868 1492 1256 S 0.0 4.9 0:16.42 apache2
2863 root 16 0 2824 492 388 S 0.0 1.6 9:32.03 nmbd
573 root 16 0 5024 468 320 S 0.0 1.5 0:00.52 smbd
3172 bernie 16 0 2032 440 244 S 0.3 1.5 1:19.07 screen
1320 root 17 0 1040 376 240 R 2.9 1.2 1:11.04 top
612 bernie 16 0 4992 344 248 S 0.0 1.1 0:11.53 sshd
903 root 16 0 9360 340 288 S 0.0 1.1 0:00.25 apache2
2716 nobody 15 0 820 256 184 S 0.0 0.8 9:46.46 gkrellmd
610 root 16 0 4988 196 192 S 0.0 0.6 0:00.59 sshd
904 apache 25 0 8920 192 164 S 0.0 0.6 0:00.01 apache2
618 bernie 16 0 1340 160 132 S 0.0 0.5 0:00.06 screen
2997 root 16 0 620 136 104 S 0.0 0.4 0:25.33 cron
613 bernie 16 0 1536 136 132 S 0.0 0.4 0:00.16 bash
2107 root 15 0 748 132 80 S 0.0 0.4 0:08.61 syslog-ng
...snip |
|
|
Back to top |
|
|
bxwen n00b
Joined: 03 Jul 2005 Posts: 15
|
Posted: Sat Dec 30, 2006 10:50 pm Post subject: |
|
|
I have torrentflux working also. But mysqld prevents my hard drive spinning down. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|