Evaggelos Balaskas - System Engineer

The sky above the port was the color of television, tuned to a dead channel

Blog
Posts
Wiki
About
Contact
rss.png twitter linkedin github gitlab profile for ebal on Stack Exchange

Next Page »
  -  
Sep
30
2011
ebalaskas: i am trying medit…
Posted by ebalaskas timeline at 11:58:46 in microblogging

identica.pngi am trying medit (mooedit.sf.net) as an geany alternative editor. First impression: Good

from Updates from ebalaskas on Identi.ca!

Sep
30
2011
ebalaskas: RT @ddevine The !archlinux…
Posted by ebalaskas timeline at 11:19:59 in microblogging

identica.pngRT @ddevine The !archlinux community feels similar to the !fedora community - which is a good thing :D They share lots of values and int …

from Updates from ebalaskas on Identi.ca!

Sep
30
2011
ebalaskas: RT @hackerspacegr Σήμερα στις…
Posted by ebalaskas timeline at 11:19:52 in microblogging

identica.pngRT @hackerspacegr Σήμερα στις 19.00: The Hackerspace Show Episode 1 http://goo.gl/zpd1i

from Updates from ebalaskas on Identi.ca!

Sep
30
2011
ebalaskas: benchmark - find &…
Posted by ebalaskas timeline at 11:16:40 in microblogging

identica.pngbenchmark - find & delete http://ur1.ca/58ylc

from Updates from ebalaskas on Identi.ca!

Sep
30
2011
benchmark - find & delete
Posted by ebal at 11:12:33 in planet_ellak, planet_Sysadmin

I usually use find to search for files and analyze the output.

Reading the manual page i learned about nouser & nogroup test expressions.

So i’ve tried some test to find the quicker (or a better way) to remove files with find.

First, lets create a demo dir and a lot of files


# cp -ra /usr /usr.test
# chown -R 10101.10101 /usr.test

How many files do we have ?


# time find /usr.test/ -xdev | wc -l 
124298

real    0m0.575s
user    0m0.243s
sys 0m0.363s

Ok, 124.298 files are a lot!

If i want to delete the entire directory via rm, the running time will be:


# time rm -rf usr.test/

real    0m5.883s
user    0m0.287s
sys 0m5.063s

5.88 seconds !

A walk through entire tree path:


# time find /usr.test/ -xdev -nouser > /dev/null

real    0m6.480s
user    0m2.763s
sys 0m3.660s

6.48 secs. It’s faster to remove them!

We now have a base to compare our results.
We will try 3 methods:

a. -delete find option
b. -exec find option
c. xargs via pipe

First Method


# time find /usr.test/ -xdev -nouser -delete 

real    0m12.739s
user    0m2.826s
sys 0m9.513s

12.74 secs. Thats the twice amount of time

Second Method


# time find /usr.test -xdev -nouser -exec rm -rf {} ; 

real    0m6.307s
user    0m0.253s
sys 0m5.516s

6.3 secs. Same as rm (that was expected by the way).

Third Method


# time find /usr.test/ -xdev -nouser | xargs rm -rf

real    0m4.666s
user    0m1.117s
sys 0m3.426s

4.66 secs!

So xargs is the faster way for the above methods

  • 3 comments
Sep
29
2011
ebalaskas: color daemon
Posted by ebalaskas timeline at 08:16:35 in microblogging

identica.pngcolor daemon http://ur1.ca/58in1

from Updates from ebalaskas on Identi.ca!

Sep
29
2011
ebalaskas: RT @meskarune Poll: What…
Posted by ebalaskas timeline at 08:07:39 in microblogging

identica.pngRT @meskarune Poll: What Linux distro do you use? http://ur1.ca/56ydw

from Updates from ebalaskas on Identi.ca!

Sep
29
2011
ebalaskas: voted for “Arch Linux”
Posted by ebalaskas timeline at 08:07:25 in microblogging

identica.pngvoted for “Arch Linux“

from Updates from ebalaskas on Identi.ca!

Sep
23
2011
ebalaskas: voted for “Hell yeah!”
Posted by ebalaskas timeline at 05:36:30 in microblogging

identica.pngvoted for “Hell yeah!“

from Updates from ebalaskas on Identi.ca!

Sep
22
2011
Εισαγωγικά μαθήματα Linux
Posted by ebal at 12:31:46 in planet_ellak

Εισαγωγικά μαθήματα Linux
( εγκατάσταση / γνωριμία με το λειτουργικό / γνωριμία με την γραμμή εντολών )

Κάθε Τρίτη στον χώρο του hsgr από τις 17.00 μέχρι τις 20.00 θα
πραγματοποιούνται παρουσιάσεις γύρω από το λειτουργικό σύστημα Linux.

Ξεκινάμε την Τρίτη 27 Σεπτεμβρίου 2011 στις 17.00.
Θα παρουσιάσουμε αναλυτικά την εγκατάσταση δύο δημοφιλή διανομών.
Fedora & Ubuntu.

ΥΓ: Φυσικά το hsgr μπορεί να φιλοξενήσει οποιοδήποτε
workshop/παρουσίαση θέλετε κι εσείς να πραγματοποιήσετε.

hackerspace.gr

Evaggelos Balaskas
Unix System Engineer - http://balaskas.gr.

Sep
20
2011
ebalaskas: You have to have…
Posted by ebalaskas timeline at 11:38:49 in microblogging

identica.pngYou have to have SystemRescueCd in your keychain

from Updates from ebalaskas on Identi.ca!

Sep
20
2011
ebalaskas: RT @hackerspacegr Σήμερα στις…
Posted by ebalaskas timeline at 09:41:02 in microblogging

identica.pngRT @hackerspacegr Σήμερα στις 19.00: CC Meetup 20110920 http://goo.gl/tDqDk

from Updates from ebalaskas on Identi.ca!

Sep
20
2011
ebalaskas: αυτός που έκανε την…
Posted by ebalaskas timeline at 05:15:08 in microblogging

identica.pngαυτός που έκανε την μετάφραση του identi.ca web template ας μάθει ελληνικά πρώτα. Τα κεφαλαία γράμματα ΔΕΝ τονίζονται!

from Updates from ebalaskas on Identi.ca!

Sep
14
2011
ebalaskas: RT @lwnnet Release for…
Posted by ebalaskas timeline at 05:09:22 in microblogging

identica.pngRT @lwnnet Release for CentOS-5.7 i386 and x86_64 http://lwn.net/Articles/458840/rss

from Updates from ebalaskas on Identi.ca!

Sep
06
2011
ebalaskas: Question: Can i migrate…
Posted by ebalaskas timeline at 08:37:48 in microblogging

identica.pngQuestion: Can i migrate a windows server into rhev ? Clonezilla –> convert image –> import into rhev ??? #RedHat #Virtualization

from Updates from ebalaskas on Identi.ca!

Sep
02
2011
ebalaskas: https://balaskas.gr/blog/index.php/2011/09/02/how-a-memory-leak-can-destroy-your-evening/
Posted by ebal at 09:50:33 in microblogging

identica.pnghttps://balaskas.gr/blog/index.php/2011/09/02/how-a-memory-leak-can-destroy-your-evening/

from Updates from ebalaskas on Identi.ca!

Sep
02
2011
How a memory leak can destroy your evening.
Posted by ebal at 09:49:04 in blog, planet_ellak, planet_Sysadmin

Yesterday evening i had the pleasure to watch my apache crashing till the entire memory of my vps server was been consumed.
I had the opportunity to see a memory leak and drink a couple of beers among good friends.
Friends that can support you (psychological) till you find the bug (is it?) and fix it.

So lets begin our journey:

My blog engine (flatpress) has a identi.ca/twitter plugin for posting entries on my blog.
I’ve connected it with my identi.ca account and i ‘ve done a little hack to add a microblogging category to separate my rss feed from my blogging rss feed (category=1)

So the main problem was(is) that the identica.png image doesnt get the correct file path from php variable.
It should be something like that:

blog/fp-plugins/identicaconnect/res/identica.png

but it seems to be:

https://balaskas.gr/blog/https://balaskas.gr/blog/blog/fp-plugins/identicaconnect/res/identica.png

That would be easy to fix, right?
That was what i thought too.

But in the process or fixing it, i saw the below error on my apache logs:

“PHP Notice: Undefined index: PATH_INFO”

I fired up my php.info page and saw that there wasnt any value for the $_SERVER[’PATH_INFO’]
In fact there wasnt any $_SERVER[’PATH_INFO’] in PHP Variables !!!

WTF ?

I was searching for an answer on google and i was noticing that my site was inaccessible.

pgrep httpd | wc -l

showed me about 200 apache threads and rising really fast.

dmesg complaint about resource and at that moment my vps crashed for the first time with a memory leak in console !!!

My previous apache installation was : httpd 2.0.64 + php-5.3.3 + suhosin-patch-5.3.3-0.9.10.patch + mod_evasive + eaccelerator-0.9.6.1 and my apache custom compilation options were:

./configure     
        --enable-dav 
        --enable-rewrite 
        --enable-ssl 
        --enable-so 
        --enable-proxy 
        --enable-headers 
        --enable-deflate 
        --enable-cache 
        --enable-disk-cache

my php compilation options were:

./configure  
        --with-zlib     
        --with-openssl  
        --with-gd       
        --enable-mbstring 
        --with-apxs2=/usr/local/apache2/bin/apxs 
        --with-mysql 
        --with-mcrypt 
        --with-curl

When i saw the memory leak, my first (and only) thought was: killapache.pl !

In a heartbeat, i was compiling httpd-2.2.20 + php-5.3.8 + suhosin-patch-5.3.7-0.9.10.patch + eaccelerator-0.9.6.1 + mod_evasive, i had moved my /usr/local/apache2 folder to apache2.bak and installed the newest (and hopefully most secure) version of apache & php.

I have pretty well document all of my installations process and i am keeping comments for every line in configuration files i have ever changed. So to setup up httpd 2.2.20 was in indeed a matter of minutes.

I was feeling lucky and confident.

I started apache and fired up my blog.
I was tailing error logs too.

BUM !!!!

apache had just crashed again !!!!

WTF^2 ?

How can a null php variable, crash apache with a memory leak and open about a million threads?
After debugging it, i fix it by just putting an isset function in front of $_SERVER[’PATH_INFO’] php variable !!!!

Too much trouble to fix (i didnt) the path of an image in my blog.

So my question is this:

  • Is this an apache bug ?
  • Is this a php bug ? or
  • Is it a software bud (flatpress) ?
Tag(s): httpd, php
    Tag: httpd, php
Sep
02
2011
ebalaskas: Whats your name ?…
Posted by ebal at 08:31:15 in microblogging

identica.pngWhats your name ?

from Updates from ebalaskas on Identi.ca!

Sep
01
2011
ebalaskas: I said “Plz ignore”….
Posted by ebalaskas timeline at 19:34:31 in microblogging

identica.pngI said “Plz ignore”. You didnt !

from Updates from ebalaskas on Identi.ca!

Sep
01
2011
ebalaskas: plz ignore
Posted by ebalaskas timeline at 18:21:50 in microblogging

identica.pngplz ignore

from Updates from ebalaskas on Identi.ca!

Next Page »
  -  

Search

Admin area

  • Login

Categories

  • blog
  • wiki
  • pirsynd
  • midori
  • books
  • archlinux
  • movies
  • xfce
  • code
  • beer
  • planet_ellak
  • planet_Sysadmin
  • microblogging
  • UH572
  • KoboGlo
  • planet_fsfe

Archives

  • 2022
    • November
    • October
    • August
    • February
  • 2021
    • November
    • July
    • June
    • May
    • April
    • March
    • February
  • 2020
    • December
    • November
    • September
    • August
    • June
    • May
    • April
    • March
    • January
  • 2019
    • December
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2018
    • December
    • November
    • October
    • September
    • August
    • June
    • May
    • April
    • March
    • February
    • January
  • 2017
    • December
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2016
    • December
    • November
    • October
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2015
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • January
  • 2014
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2013
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2012
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2011
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2010
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2009
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
Ευάγγελος.Μπαλάσκας.gr

License GNU FDL 1.3 - CC BY-SA 3.0