zend_mm_heap corrupted in the phpfpm error.log
vpetrykanyn
I've got "zend_mm_heap corrupted" in the error.log.
Something like this:
[10-Apr-2016 04:58:09] WARNING: [pool www] child 31054 said into stderr: "zend_mm_heap corrupted"

I found no corresponded events that can reveal a problem. On the stackoverflow there are a lot of suggestions how to overcome this, but all is different.

After some time I've noticed SIGSEGV errors. That pushed me to enable core dumps. In the few days two core dump have been catched. Here is an backtrace from core dump analysis.

#0 0x000000000056af87 in zend_mm_remove_from_free_list (heap=<optimized out>, mm_block=0x2ea84e0) at /usr/src/debug/php-5.5.31/Zend/zend_alloc.c:815
#1 0x000000000056b18b in _zend_mm_free_int (heap=0x2050350, p=0x2ea88d0) at /usr/src/debug/php-5.5.31/Zend/zend_alloc.c:2110
#2 0x00000000005a075e in zend_hash_destroy (ht=0x99f270 <executor_globals+432>) at /usr/src/debug/php-5.5.31/Zend/zend_hash.c:565
#3 0x0000000000582fc3 in shutdown_executor () at /usr/src/debug/php-5.5.31/Zend/zend_execute_API.c:319
#4 0x0000000000592b72 in zend_deactivate () at /usr/src/debug/php-5.5.31/Zend/zend.c:946
#5 0x0000000000532f12 in php_request_shutdown (dummy=dummy@entry=0x0) at /usr/src/debug/php-5.5.31/main/main.c:1813
#6 0x0000000000421934 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/php-5.5.31/sapi/fpm/fpm/fpm_main.c:1981

That tells nothing to me. But googling helps. I've found this bug report - https://bugs.php.net/bug.php?id=69190
The author has fixed the issue by disabling fast_shutdown in the opcache's configuration. Actually that helps me too.

How to change author of commits in the GIT
vpetrykanyn

#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags


For more information, please, read this article.

Also, one more, but using git rebase way - Link

Clean unnecessary git branches
vpetrykanyn
EXCEPTIONS variable contains branches that will be ignored.

EXCEPTIONS="master|develop|\*"; for branch in `git branch | egrep -v "($EXCEPTIONS)" | xargs`; do git branch -D $branch; done
Tags: ,

python generators and coroutings
vpetrykanyn
Читаю "A Curious Course on Coroutines and Concurrency" by David Beazley

Вот где сила python.
Tags:

Пополняю свою python библиотеку. mylib.extend(["psutils", "scapy"])
vpetrykanyn
Теперь в мой арсенал добавились psutils и Scapy.

Psutils для получения информации о процесах, памяти, cpu и тд. Плюс, что не нужно выполнять системные команды и парсить вывод.

Scapy интерактивный, я бы даже назвал, фрейворк для сворки сетевых пакетов, сбора и анализа трафика. Предоставляет уровен повыше, по сравнению с использованим библиотеки socket напрямую. Начинаю осваивать все его возможности.
Tags:

python generators
vpetrykanyn
List comprehansion:
result = [ i for i in some_iter_object ]

Genarator:
result = ( i for i in some_iter_object )

In last case result is generator, but in first case result is a list.

https://wiki.python.org/moin/Generators
Tags:

A very good explanation of Load Avarage metric
vpetrykanyn

The traffic analogy

A single-core CPU is like a single lane of traffic. Imagine you are a bridge operator ... sometimes your bridge is so busy there are cars lined up to cross. You want to let folks know how traffic is moving on your bridge. A decent metric would be how many cars are waiting at a particular time. If no cars are waiting, incoming drivers know they can drive across right away. If cars are backed up, drivers know they're in for delays.

So, Bridge Operator, what numbering system are you going to use? How about:


  • 0.00 means there's no traffic on the bridge at all. In fact, between 0.00 and 1.00 means there's no backup, and an arriving car will just go right on.

  • 1.00 means the bridge is exactly at capacity. All is still good, but if traffic gets a little heavier, things are going to slow down.

  • over 1.00 means there's backup. How much? Well, 2.00 means that there are two lanes worth of cars total -- one lane's worth on the bridge, and one lane's worth waiting. 3.00 means there are three lane's worth total -- one lane's worth on the bridge, and two lanes' worth waiting. Etc.

Read more

What is the Difference Between Visits, Views, and Hits?
vpetrykanyn
Visit - Is someone who comes to your Web site and looks around a bit. They may go to one page or they may go to 100 pages, but they're still only visiting once.

View (Page) - Is how many pages were seen by that visit

Hit - Is how many physical resources were requested from the server by that visit. Pages are made up of many items (images, text, etc). Each of those is a hit, while a view is the page itself.

Think of it like a book store. A person goes into the store (visit) and picks up five books to buy (views). While he is holding the books, he flips through them and looks at a few pictures (hits). So he would have one visit to the store, five books handled during his visit (views), and maybe 30 pictures he looked at (hits).

So which value is more useful? It depends on the use of the information. If you're in marketing and you're striving for bragging rights or high activity numbers, use hits. However, if you are using your stats to actually identify trends and the personal impact of your site, use views and visits. Hits can always be inflated artificially by adding a few more images to a page, for example. Visits and views, however, represent people coming to your site and the number of Web pages they saw, which is much more useful for analyzing usage patterns.

Source


PIPE_BUF in Linux
vpetrykanyn
Read more...Collapse )
Tags: ,

Centos 6 and cpuspeed service
vpetrykanyn
Super server used on half power.

grep -E '^model name|^cpu MHz' /proc/cpuinfo
model name    : Intel(R) Xeon(R) CPU E31230 @ 3.20GHz
cpu MHz        : 1600.000
model name    : Intel(R) Xeon(R) CPU E31230 @ 3.20GHz
cpu MHz        : 1600.000
model name    : Intel(R) Xeon(R) CPU E31230 @ 3.20GHz
cpu MHz        : 1600.000
model name    : Intel(R) Xeon(R) CPU E31230 @ 3.20GHz
cpu MHz        : 1600.000
model name    : Intel(R) Xeon(R) CPU E31230 @ 3.20GHz
cpu MHz        : 1600.000
model name    : Intel(R) Xeon(R) CPU E31230 @ 3.20GHz
cpu MHz        : 1600.000
model name    : Intel(R) Xeon(R) CPU E31230 @ 3.20GHz
cpu MHz        : 1600.000
model name    : Intel(R) Xeon(R) CPU E31230 @ 3.20GHz
cpu MHz        : 1600.000
Tags: ,

?

Log in

No account? Create an account