How to calculate the innodb_buffer_pool_size im my.cnf

In order to properly calculate the size of the innodb_buffer_pool_size directive in MySql configuration we need to find the RIBPS.
RIBPS is the : Recommended InnoDB Buffer Pool Size based on all InnoDB Data and Indexes with an additional 60%.

So you fire up an sql session and run the following query :

SELECT CEILING(SUM(data_length+index_length)/POWER(1024,2)) RIBPS FROM information_schema.tables WHERE engine='InnoDB';

The output is the number we are after :


+-------+
| RIBPS |
+-------+
| 5053 |
+-------+

So in the configuration of MySql server (usually in /etc/mysql/my.cnf)
we add the following :


[mysqld]
innodb_buffer_pool_size=5053M

Given the amount of data and index pages for your dataset, having a small Buffer Pool will just cause data and index pages accessed to rotate out and load new pages as needed (like low memory and swap in Linux). Having the Buffer Pool too big would just wastes RAM so its critical to set it just right.

Tip : Use the following query after the mysql db has run for a week or so (or before restarting it, so that you dont have to wait for another week!) to see how many actual pages of InnoDB data reside in the InnoDB Buffer Pool.

SELECT (PagesData*PageSize)/POWER(1024,3) DataGB FROM
(SELECT variable_value PagesData
FROM information_schema.global_status
WHERE variable_name='Innodb_buffer_pool_pages_data') A,
(SELECT variable_value PageSize
FROM information_schema.global_status
WHERE variable_name='Innodb_page_size') B;

Have fun!

The future of SEO – Part I

Yesterday i stumbled across a weird figure of google plus statistics that might become critical in the near future of SEO.

Considering that Google’s Pagerank algorithm increasingly focuses on social signals deriving from various sources, it is becoming clear that we are moving out from traditional link building to social media voting.

Authorship value, now linked  to the web through structured data, will heavily rely on user reviews and will be promoted through search as personalized content. Keywords will be replaced by contexts and keyword research and analysis in SEO will become obsolete, as geotargeting, voice search and social sharing will take search to a level where search queries will no longer be needed.

To be continued…

Downgrade PHP 5.4 to PHP 5.3

So you got your fresh Debian 7 installed and realized in terror that it ships with PHP 5.4!

Most of the popular CMS out there are not ready for the changes in php core yet so you actually need to downgrade php 5.4 to php 5.3.
Here is how :

Most of the commands are self explanatory so you could just just copy & paste them into cli.

Edit the /etc/apt/sources.list file

vi /etc/apt/sources.list

and add the old Debian 6 repositories

deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze main contrib non-free

save the file

Create the /etc/apt/preferences.d/preferences file that will allow us to “pin” the older php packages to whatever we like.
vi /etc/apt/preferences.d/preferences

and insert the packages you need to have downgraded to previous version
usually the following are enough but modify further if needed

Package: php5*
Pin: release a=oldstable
Pin-Priority: 700

Package: libapache2-mod-php5
Pin: release a=oldstable
Pin-Priority: 700

Package: libapache2-mod-php5
Pin: release a=oldstable
Pin-Priority: 700

Package: php-pear
Pin: release a=oldstable
Pin-Priority: 700

Package: *
Pin: release a=stable
Pin-Priority: 600

Now remove the pre-installed php 5.4 and all its dependencies with the following command
aptitude remove `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`

Update the apt-get so we it can find the older php version
apt-get update

Tell the system to install the version we want and previously pinned in the preferences file
apt-get -t oldstable install `dpkg -l | grep php5| awk '{print $2}' |tr "\n" " "`

Confirm success with the following
dpkg -l | grep php

Restart apache
/etc/init.d/apache2 restart

And there you have it! Brand old php 5.3 in Debian 7 :
Greeeat succeeeess!

borat_great_success

Το απόλυτο PC για gaming

Η Origin PC ανακοίνωσε έναν νέο υπολογιστή, ο οποίος βρίσκεται σε μια δική του κατηγορία, καθώς ξεφεύγει σε μεγάλο βαθμό από τα όρια του συμβατικού PC. Ο θηριώδης υπολογιστής ονομάζεται Big O και περιλαμβάνει τεχνικά χαρακτηριστικά που προκαλούν δέος. Ωστόσο, το μεγάλο του πλεονέκτημα δεν είναι ούτε οι επεξεργαστές, ούτε οι μνήμες, ούτε οι κάρτες γραφικών.

Πέρα από το “συνηθισμένο” hardware, ο Big O κρύβει στο εξωτερικό του ένα ολόκληρο Xbox 360 Slim (!), το οποίο διαθέτει υδρόψυξη. Έτσι, ο χρήστης μπορεί να παίζει τη μία στιγμή Halo 3 και την άλλη StarCraft II μέσα από το ίδιο μηχάνημα. Από εκεί και πέρα, το καμάρι της Origin PC διατίθεται σε δύο configurations, τα οποία έχουν διαφορές στο hardware.

Το μεγάλο μοντέλο κοστίζει 17.000 δολάρια και περιλαμβάνει δύο επεξεργαστές Xeon X5680 υπερχρονισμένους στα 4.3GHz, τέσσερις GeForce GTX 480, 12GB μνήμη, δύο τροφοδοτικά με το καθένα να αποδίδει 1kW, solid-state drive 200GB και δύο σκληρούς δίσκους με χωρητικότητα 2TB ο καθένας.

Το μικρό (τρόπος του λέγειν) μοντέλο έχει τιμή 7.669 δολάρια και αντικαθιστά τους δύο Xeon με έναν ταπεινό Core i7 930.

Πηγή: techreport