Tuesday, December 20, 2016

Centos 7 Install Realtime kernel using yum

Wanted to try out an rt kernel for my asterisk box. One option is to build a patched kernel.. The other option I am trying out now is to install using the Cern repo. I am using a plain Centos 7 installation and not the Cern version. At the time of writing this I had to install an older version of tuned in order to successfully finish the process:
yum install http://ftp.ntua.gr/mirror/centos/7.2.1511/updates/x86_64/Packages/tuned-2.5.1-4.el7_2.6.noarch.rpm
Install the repo in /etc/yum.repos.d/Centos-RT.repo:
name=CentOS-$releasever - RealTime
Finally yum groupinstall RT should install the rt kernel. Reboot to use. I am currently trying it on a VM and so far no issues.

Some initial tests:

RT Version (VM):
chrt -f 99 ./cyclictest -t1 -p 80 -i 10000 -n -l 100000
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 0.12 0.16 0.10 1/120 10969

T: 0 (10960) P:80 I:10000 C:  16390 Min:      6 Act:   20 Avg:   70 Max:   12866

hdparm -t /dev/sda2
Timing buffered disk reads: 976 MB in  3.07 seconds = 317.71 MB/sec

Normal Version (VM):
chrt -f 99 ./cyclictest -t1 -p 80 -i 10000 -n -l 100000
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 0.95 0.37 0.14 1/108 10165

T: 0 ( 8828) P:80 I:10000 C:   4838 Min:      5 Act:  413 Avg:  210 Max:    7676

hdparm -t /dev/sda2
Timing buffered disk reads: 1014 MB in  3.01 seconds = 336.37 MB/sec

After repeating the VM tests, I concluded that the VM is not the proper way to test. I will try it on real hardware later and post the results.

Normal Version (E5140 - 2 Cores):
chrt -f 99 ./cyclictest -t1 -p 80 -i 10000 -n -l 100000
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 0.10 0.04 0.05 1/332 9408

T: 0 ( 9339) P:80 I:10000 C:   6901 Min:      3 Act:    3 Avg:    6 Max:    4503
hdparm -t /dev/sda2
Timing buffered disk reads: 526 MB in  3.01 seconds = 175.04 MB/sec

Tuesday, August 2, 2016

Alcatel OneTouch L850V

This dongle is recognized out of the box under Centos 7. You get a usbX device. You need to run a dhcp client on the device or there is the option to set an address 192.168.2.[2-254] cause the dongle WUI has There is a hidden menu to access and disable the dhcpd server  on the dongle so that you won't need to use dhcp client hooks to avoid your rooting table and dns settings getting changed.


Tuesday, February 9, 2016

Compile deluged in Centos 7 x86_64

In a proper build environment:

yum install boost-devel libgeoip (not supported anymore)

Get the latest libtorrent (1.1.2 at the time). To build it use b2.

cd /usr/local/src/
mkdir deluge
cd deluge
wget https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_1_2/libtorrent-rasterbar-1.1.2.tar.gz
tar -xvf  libtorrent-rasterbar-1.1.2.tar.gz
cd  libtorrent-rasterbar-1.1.2

Edit Jamfile and set all TORRENT_USE_ICONV from 0 to 1.

#build libtorrent
b2 toolset=gcc link=shared variant=release target-os=linux address-model=64 crypto=openssl
 # produces  bin/gcc-4.8.5/release/address-model-64/crypto-openssl/threading-multi/libtorrent.so.1.1.2

cp bin/gcc-4.8.5/release/address-model-64/crypto-openssl/threading-multi/libtorrent.so.1.1.2 /usr/local/lib

cd bindings/python/

#build python bindings
b2 toolset=gcc link=shared variant=release target-os=linux address-model=64 libtorrent-link=shared

# produces: bin/gcc-4.8.5/release/address-model-64/libtorrent-python-pic-on/visibility-hidden/libtorrent.so

# we need to set the this otherwise deluge setup will try to build libtorrent in a way that does not work


cd /usr/local/src/deluge/
wget http://download.deluge-torrent.org/source/deluge-1.3.12.tar.bz2 # or get from git or whatever
 tar -xvf deluge-1.3.12.tar.bz2

cd deluge-1.3.12
ln -s  /usr/local/src/delug/libtorrent-rasterbar-1.0.8 libtorrent

python setup.py build
python setup.py install # or bdist if you wise and did that in a virtual environment etc

You need to copy libtorrent python binding somewhere (like under deluge in /usr/lib/python/site-packages/deluge-1.3.12/deluge) or set the PYTHONPATH in order for the module to be found in runtime.