-rw-r--r-- 10K Feb 16, 2012 · BFD8BAC · ~9 min

A Couple of Thoughts on OS X Mountain Lion 10.8

mac os x mountain lion it размышления apple

Mac OS X 10.7 Mountain Lion

[↵] open page para-myslei-pro-os-x-mountain-lion-10-8.md
-rw-r--r-- 1.3K Feb 7, 2012 · AAF2458 · ~2 min

Teide Volcano on Tenerife

tenerife teide canon 60d spain

We climbed Teide volcano on Tenerife. It takes a little over an hour by bus to get to the base. Then we had to wait for the cable car because it was not working due to the wind. We were already thinking that we would never get there after all. But it did start working. The cable car takes you up to an altitude of 3500 meters above sea level. After that, with a special permit (I think from the national guard), which can be obtained through the website, you can climb up to the crater itself. In the end you find yourself at an altitude of 3710 meters, at the highest point in Spain. Those 210 meters along a stone path shaped like stairs were not easy. Cold, wind, lack of oxygen. You run out of breath every 20 meters and have to stop to catch it. Your heart pounds like crazy. But it is worth it. The beauty is indescribable; you are standing above the clouds, and you can even see the island of Gran Canaria from above. You do not think very clearly, but I climbed onto the highest rock I could find. The crater itself is nothing special: a rounded depression, the smell of sulfur, and in some places white smoke breaking out from under the stones. But the views there are amazing. I shot a little video. Almost without any editing, we just laid the video over music.

Music: Jon Hopkins - Insides.

[↵] open page vulcan-teide-na-tenerife.md
-rw-r--r-- 3.3K Jan 24, 2012 · B4435AA · ~3 min

A Couple of Thoughts on Pavel Durov's Talk at DLD 2012

вконтакте vk dld павел дуров

Павел Дуров на DLD 2012

Today was the 3rd day of the DLD 2012 conference (Digital, Life, Design). A couple of thoughts, just to reason them through.

[↵] open page para-myslei-o-vystuplenii-pavla-durova-na-dld-2012.md
-rw-r--r-- 2.3K Jan 20, 2012 · F617F2E · ~2 min

Nginx Error: Too many open files

nginx шпаргалки

About speeding things up. A couple of useful points.

As is well known, browsers limit the number of simultaneous connections per domain while loading a site. Because of this, site elements are loaded sequentially. Every image/js/css file is a separate connection. If there are many such elements on a site's pages, you can speed up loading by moving static assets to subdomains. For example: s1.domain.com, s2.domain.com, and so on. So if the browser has, say, a limit of 5 connections per domain, now you get 5 connections for each subdomain. If you spread everything out correctly, load speed can theoretically increase almost fivefold.

The downside: the number of simultaneous connections to the server also grows. With the same site traffic, the number of connections grows by about 5 times as well (if you have 5 subdomains). If Nginx is the frontend, it has a limit on the number of connections in its config. And since there are now 5 times more connections, it also has to do more work at the same time than before. So with this acceleration we are also pushing Nginx closer to its simultaneous connection limit, and as a result the site may fail to open for the user or some files may simply not be served during loading.

The Nginx logs will show an error like:

"...socket() failed (24: Too many open files) while connecting to upstream..."

To see the current limit from the console:

ulimit -n

To see it nicely formatted like this:

nginx: worker process

Limit                     Soft Limit           Hard Limit           Units
Max open files            1024                 1048576              files
Currently open files: 945

nginx: master process /usr/sbin/nginx
Limit                     Soft Limit           Hard Limit           Units
Max open files            1024                 1048576              files

you can run this in the console:

for pid in `pidof nginx`; do echo "$(< /proc/$pid/cmdline)"; egrep 'files|Limit' /proc/$pid/limits; echo "Currently open files: $(ls -1 /proc/$pid/fd | wc -l)"; echo; done

To change the limit:

  • add these lines to /etc/security/limits.conf:
    * soft nofile 16384
    * hard nofile 16384
  • run as root:
    ulimit -n 16384
  • restart Nginx, just in case.

They also write that you can simply add this to the Nginx config:

worker_rlimit_nofile 16384

and restart it.

[↵] open page oshibka-nginx-too-many-open-files.md
-rw-r--r-- 4.1K Jan 19, 2012 · 5718D6C · ~3 min

Apple Education Event, January 19, 2012

apple apple education event ibooks 2 ibooks author

Apple Education Event

What was shown.

[↵] open page apple-education-event-19-yanvarya-2012.md
-rw-r--r-- 2.4K Jan 13, 2012 · 78111A5 · ~2 min

A Useful Thing: Prefix.pch

ios objective-c precompiled headers

I discovered a useful thing in iOS development: the Prefix.pch file, a Precompiled Header.

From the description, Precompiled Headers are compiled, cached, and then automatically included into every file being compiled. So if there is some class that is needed everywhere or almost everywhere in a project, you can include that class inside the Prefix.pch file, which is created automatically in a new project, and it will be available everywhere. I really didn't like having to include the same class again and again in every View Controller when it was needed almost everywhere.

[↵] open page poleznaya-shtuka-prefix-pch.md
makoni@arm1:~/blog$ cd ../page-32/ // ← previous cd ./page-34/ // more posts →