Jump to content

Debian Jessie on Bananapi, logging performance


Recommended Posts

Posted

Hi all,

 

is anyone running Debian Jessie on a Bananapi? I'd like to upgrade from debian wheezy to Jessie, but I am afraid of a performance degrade due to the fact that ramlog is not available for Jessie. Since linux tends to write a lot of things to its logs, do you know wether Jessie performs worse, better or the same as Wheezy on Bananapi?

 

I use my board as a proxy, router and web server...

Posted
service ramlog disable
reboot

and see how this affect your scenario.

 

I never made such comparison because it's much related to the particular case. This forum and few other webs are on one single A20 with budget SD card. I am using memory for log caching as well for caching (memcached) HTML/PHP and SQL. Using no caching vs full is like day and night. Huge difference. 

Posted

So, you're basically confirming what I was worried about! :-(

 

Since I run hostapd, squid3, apache2 and other daemons, a lot of logging happens; so I would not be happy with storing logs immediately to the sd card.

 

Will the upgraded image use systemd as a vanilla debian installation? Basically, I think we could solve the ramlog absence by mounting /var/log to a tmpfs and preparing some scripts to store the logs on phisical disk on shutdown/every x period of time. I think I'll work on something like that in the future, otherwise I cannot upgrade to Jessie! ;)

Posted

Upgrade to Jessie is done via official Debian tools. I don't remember if you get systemd by default or not. Not sure about this. Try with clean image ...

 

ramlog is just the right thing and I am sad it's not developing any more. I was playing with the idea to make it work on systemd but soon realized it's not just one afternoon project.

I'll be glad to see this working on Jessie and elsewhere. If you start to move the project I'll help to push it  :)

Posted

Hi Igor,

 

I've found the ramlog source code. Looks like it needs to be tidied up... In any case, what problems did it give on Jessie in addition to the init script to be ported to systemd?

 

BTW, it is licensed under GPL v3, so I think we could easily fork it and restart its development... ;) I absolutely need it or something equivalent, otherwise the performance on my bananapi degrade too much...

Posted

In any case, what problems did it give on Jessie in addition to the init script to be ported to systemd?

 

As far as I understand it's about the order of started services (ramlog has to be the very first and the last daemon started/stopped so that all other daemon's output will be inside the ramdisk). The parallelisms introduced with systemd make this a bit hard to achieve.

 

Anyway: You can run jessie with SysV init instead of systemd. I tried to summarize the way Bananian does it here: https://olimex.wordpress.com/2015/08/26/devuan-jessie-for-olinuxino-images/#comments

Posted

Hi Igor,

 

well, I was thinking to something like that. However, ramlog has a cool feature: it can be started/stopped manually. And in fact I was able to do so on  my Jessie installation...

 

The problem is that to do so you need to stop all the daemons that keep /var/log busy, start ramlog and then start those daemons again. This is the problematic part, as ramlog is not able to start/stop daemons automatically when it is started manually.

 

 

Anyways, I think that the problem could be solved by writing a proper systemd service. In fact, it should support the before= clause, whose meaning should be obvious... :D

Posted

Having Jessie without systemd is an option but not a cool one. Systemd has advantages and also new LTS Ubuntu is getting it by default. On long run = systemd.

 

I am currently not involved in systemd enough to shoot out what's the right solution or where to start. It has been a year or so when I was doing Jessie implementation and my scripts are not this much critical so it was relatively an easy job.

 

We are looking for some "exclusive starting" or similar. Manual start or stop is not needed. This ain't working with current version on Wheezy either.

Posted

Hi Igor,

 

this afternoon I made some progress. I now have a service for systemd that should start/stop ramlog appropriately, i.e. before syslog. I do not know wether this is enough, but anyways I'm going to give it a try. I'll let you know in a few minutes...

Posted

ramlog.service.zipI think the systemd service should do its job properly. Unfortunately, ramlog does not start. In fact, even if

 

ramlog teststartstop

 

gives a positive result, running

 

ramlog start

 

fails and reports the following message:

 

[....] Starting ramlog-tmpfs 2.0.0: /bin/cp: ‘/var/log.hdd/.’ and ‘/var/log/.’ are the same file.

failed!

 

Do you have any idea on what might be causing this problem?

Posted

Prior to coping from hdd to ram, /var/log must be already mounted under some type of tmpfs?

Posted

If I'll look to much into the code I'll solve it but I am anyway looking into (other) code the whole day :)

 

Step by step, check what's needed and not done. It could also be some very basic. Jessie and Wheezy have different default system packages from which such scripts are depend on.

Posted

Hi Igor,

 

I'll definitely keep looking into it, even if I am tempted to start developing a similar solution from scratch. In fact, the concept is pretty simple. It surely won't be as flexible as ramlog, but I think I could make it work for sure.., not to mention the fact that the systemd service is already done.

 

In any case, my kernel process hit eof for today! :-) Having read the whole systemd documentation and written my first service is enough! :D

 

I'll be back tomorrow! :-)

Posted

Good! The concept is simple, yes ... just persistence is the key to get it working under all conditions :)

 

Just keep it going.

 

I buy a beer when done ;)

Posted

Hi Igor,

 

I didn't forget about this task, but I just didn't have enough time to work on it. :( Let's add to this that bash scripting is not my favorite language... Et voilà, the picture is complete!

 

Now I have something that should work and I plan on setting up a github repository tomorrow. Is GPL v3 or later licensing fine for eventual inclusion in your armbian images?

 

Initially I'll be supporting just Debian Jessie, but I could extend distro support in the future.

Posted

Nice. BTW. In the mean time I changed the default Jessie by disabling systemd by default ... for some other reasons ... and Ramlog now works with Jessie too :) 

 

Regarding licencing ... I have to alter them once, so don't bother about that.

 

What about using some type of compressed file system? As an option.

Posted

FYI, just noticed article (in Russian) describing ramlog implementation for systemd based distributions, extracted from RPi 2 image found on some german web site: http://habrahabr.ru/post/272279/

 

Small note from myself - it can be packed as debian package with pre/postinstall scripts to set it up, or just copied to fresh Armbian images, in which case it's better to stick main script in /usr/local/bin instead of /usr/bin

 

Edit: it doesn't have fallback startup script for sysvinit, but it's easy to create one.

Edit 2: I think it has copy-paste error in cron script name, it should be /usr/bin/ramlog instead of /usr/bin/crontab

  • Igor unpinned this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines