Categories
Linux

Setting cpu affinity on linux

Here is a simple way to bind a proc to a cpu. The taskset command is part of the util-linux package.

Bind process 2225 to processor 0:

taskset -p -c 0 2225

Bind process 2225 to processor 1:

taskset -p -c 1 2225

Bind process 2225 to processor 0 and 1:

taskset -p -c 0,1 2225

You can also bind a process at execution:

taskset -c 0 sshd

Retrieving the pids current affinity:

[root@localhost ~]# taskset -p 2225
pid 2225’s current affinity mask: 3

Categories
Linux

ftp vs. ftps performance data

In a previous entry Enabling ftps on vsftpd I showed how to turn on ftps in vsftpd. I have since did a little sample to see how this would affect cpu by turning on secure transfers. The results are odd, but I ran it twice and it is correct…

The ftp get script I used was a simple curl script that did 5 transfers and slept for 2 seconds then did another 5 transfers … etc .. for 10 loops, so a total of 50 transfers. I did this because i didnt want to flood the machine. This way the machine can take a break between transfers.

Here is the script:

#!/bin/bash

date
for i in $(seq 1 10)
do
        for i in $(seq 1 5)
        do
                curl -# -u ftptest:ftptest ftp://ftphost/10M.file > file
                #curl -# -u ftptest:ftptest ftp://ftphost/10M.file > file
                #curl –ftp-ssl-reqd –insecure -# -u ftptest:ftptest ftp://ftphost/1M.file > file
                #curl –ftp-ssl-reqd –insecure -# -u ftptest:ftptest ftp://ftphost/10M.file > file
        done
        sleep 2
done
date

And here are the results:

FTP 1M File – View image

FTPS 1M File – View image

FTP 10M File – View image

FTPS 10M File – View image

Categories
Linux

Example kickstart file with lvm

I was having some trouble creating a kickstart file with lvm partitions so I finally got it working, i dont know what i did, but I think it had something to do with sizing. I set the pv to grow over the entire disk and then sliced up the lv’s.

install
url –url=http://192.163.43.101/kickstart/rhel51/x86-64/base
bootloader –location=mbr
zerombr
clearpart –all
text
firewall –disabled
firstboot –disable
reboot
selinux –disabled

key –skip
lang en_US.UTF-8
keyboard us
network –device eth0 –bootproto dhcp –onboot=on
rootpw –iscrypted $1$O9sasdfe$fdadsfdsadqW4CMdO0jk0
firewall –disabled
authconfig –enableshadow –enablemd5
timezone –utc America/Los_Angeles

part /boot –fstype ext3 –size=100
part pv.01 –size=1 –grow
volgroup rootvg01 pv.01
logvol / –fstype ext3 –name=lv01 –vgname=rootvg01 –size=1000
logvol /tmp –fstype ext3 –name=lv03 –vgname=rootvg01 –size=1000
logvol swap –fstype swap –name=lv00 –vgname=rootvg01 –size=1000
logvol /home –fstype ext3 –name=lv02 –vgname=rootvg01 –size=1000
logvol /usr –fstype ext3 –name=lv04 –vgname=rootvg01 –size=5000
logvol /var –fstype ext3 –name=lv05 –vgname=rootvg01 –size=1000

%packages
@base

%post