DEBIAN ….Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

So I’m getting corrupted error msg on my Raspberry PI:

[   48.261326] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

umount /boot
 git clone http://daniel-baumann.ch/git/software/dosfstools.git
 cd dosfstools
 make
 ./fsck.fat -a /dev/mmcblk0p1

Get this output:

 fsck.fat 3.0.26 (2014-03-07)
 0x25: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
 Automatically removing dirty bit.
 Performing changes.
 /dev/mmcblk0p1: 14 files, 1232/7161 clusters

And now:

 mount /boot

Performance testing Nginx on Raspberry Pi

Having configured Nginx it is now time to test it.

I will use three tools to perform the tests: Autobench, httperf and OpenWebLoad. The principle behind them is to generate a massive amount of HTTP requests.

Autobench

is a simple Perl script for automating the process of benchmarking a web server (or for conducting a comparative test of two different web servers). The script is a wrapper around httperf. Autobench runs httperf a number of times against each host, increasing the number of requested connections per second on each iteration, and extracts the significant data from the httperf output, delivering a CSV or TSV format file which can be imported directly into a spreadsheet for analysis/graphing. For more details please refer to this website

explanation of some of the switches used:

* low rate – connections per second at the beginning of the test

*high_rate – connections per second at the end of the test

*num_call – how many requests should be sent per connection

* num_conn – total amount of connections

TSV file can be open in Excel. So based on the graph it would appear that Raspberry Pi can take approx 1000 connections per second without a loss! Not too bad for something worth so little.

Raspberry Pi – Debian – Network tools

ifstat – InterFace STATistics Monitoring

ifstat is a tool to report network interfaces bandwith just like vmstat/iostat do for other system counters. It can monitor local interfaces by polling the kernel counters, or remote hosts interfaces using SNMP.

To install run:

apt-get install ifstat

then just issue:

ifstat

example output:

eth0
 KB/s in KB/s out
 4.22 237.91
 4.19 246.90
 4.17 248.41

to be continued….

Map Box.com as a virtual disk in debian

apt-get install davfs2 libneon27-gnutls
 mkdir /box.com

now let’s test it:

Now let’s make it permanent:

cd /etc/devfs2/
 nano secrets

add

https://dav.box.com/dav email@address Password!

save and exit nano. Few checks:

chmod 0600 /etc/davfs2/secrets
 ls-la /etc/davfs2/secrets

it should say something like that:

-rw ------- 1 pi pi 58 December 28 12:01 /etc/davfs2/secrets

now:

nano /etc/fstab

and add

https://dav.box.com/dav /box.com davfs noauto,users 0 0

then

chmod u+s /usr/sbin/mount.davfs
 usermod-aG davfs2 pi
 mount /box.com

Optimizing Raspberry Pi performance

CPU

The best way to overclock Raspberry Pi it is with the raspi-config tool

raspi-config

I go for the Modest option:

 

Nginx

Modify nginx.con (/etc/nginx/nginx.conf)

We only have one CPU thread…

worker_processes  1;

In the http { section add the following:

# Optimize memory
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
sendfile        on;
tcp_nopush     on;
server_names_hash_bucket_size 128;
keepalive_timeout  65;
# Enable website compression - it takes a lot of CPU
# If you are running low on CPU disable the Zip part.
gzip  on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";

Also it is usefull to add:

#Hide Nginx version number
 server_tokens off;

 

 MySQL

Download and run this script: MySQL Tuner Perl script

perl mysqltuner.pl

then go to /etc/mysql/ and edit my.cnf accordingly.