[lang_en]
Looks like MySQL Camp 2006 was really interesting and useful for its attendees and for entire MySQL community. As the result of this meeting of many MySQL-related professionals we’ve got lots of interesting publications and I want to refer one of them in this post. Very interesting list of 84 MySQL performance tips has beed created on first day of this year MySQL Camp at Google headquarters:
- Index stuff.
- Don’t Index Everything
- Use benchmarking
- Minimize traffic by fetching only what you need.
- Paging/chunked data retrieval to limit
- Don’t use SELECT *
- Be wary of lots of small quick queries if a longer query can be more efficient
- Use EXPLAIN to profile the query execution plan
- Use Slow Query Log (always have it on!)
- Don’t use DISTINCT when you have or could use GROUP BY
- Use proper data partitions (For Cluster. Start thinking about Cluster *before* you need them)
- Insert performance
- Batch INSERT and REPLACE
- Use LOAD DATA instead of INSERT
- LIMIT m,n may not be as fast as it sounds
- …
So, I think this list can be really useful for all developers/DBAs working with MySQL and want to say “Thanks” to its authors.
[/lang_en]
[lang_ru]
Похоже, что MySQL Camp 2006 был действительно очень интересным и полезным событием как для тех, кто его посетил, так и для всего сообщества MySQL. Как результат этой встречи большого количества профессионалов, связанных с MySQL, появилось множество интересных публикаций. Именно одну из таких публикаций я и хотел бы “прорекламировать” сегодня. Очень интересный список 84 Лучших советов по производительности MySQL был создан в первый день работы MySQL Camp в штабквартире Google:
- Index stuff.
- Don’t Index Everything
- Use benchmarking
- Minimize traffic by fetching only what you need.
- Paging/chunked data retrieval to limit
- Don’t use SELECT *
- Be wary of lots of small quick queries if a longer query can be more efficient
- Use EXPLAIN to profile the query execution plan
- Use Slow Query Log (always have it on!)
- Don’t use DISTINCT when you have or could use GROUP BY
- Use proper data partitions (For Cluster. Start thinking about Cluster *before* you need them)
- Insert performance
- Batch INSERT and REPLACE
- Use LOAD DATA instead of INSERT
- LIMIT m,n may not be as fast as it sounds
- …
Я думаю, что этот список советов может быть очень полезен всем разработчикам и администраторам, работающим с MySQL и потому хочу сказать “Большое Спасибо” его авторам.
[/lang_ru]
[lang_en]
Sometimes you may need to implement controlled downloads when all downloads requests being sent to your script and then this script decides what to do: to send some file to the user or to show some access denied page or, maybe, do something else. In lighttpd server it can be done by returning X-Sendfile header from script. Nginx have its own implementation of such idea using X-Accel-Redirect header. In this short post I will try to describe how to use this feature from PHP and Rails applications.
[/lang_en]
[lang_ru]
Иногда вам может быть нужно реализовать т.н. контролируемое скачивание, когда все запросы на скачивание файлов передаются скрипту, который решает, как поступить: отправить пользователю какой-либо файл, или показать стриницу access denied, или, может быть, сделать что-то еще. При использовании сервера lighttpd это может быть реализовано при помощи заголовка X-Sendfile, возвращаемого из скрипта. Nginx имеет свою союственную реализацию описанной идеи с использованием заголовка X-Accel-Redirect. В этой короткой статье я попытаюсь описать, как использовать эту возможность из приложений на PHP или Rails.
[/lang_ru]
Read the rest of this entry →
[lang_en]
Sometimes we may need to know geocode of some specific postal location. For example, you have some shops catalogue and want to show shop locations on the map. Then, you will need to ask some service about map marker coordinates. If geocode service is not available or it can’t parse provided address, you will not be able to show map to your users. 🙁 To solve such problem I’ve created small PHP-module, that helps me to get reliable results from set of miscellaneous geocoding services.
As for now, module can use Google Maps API, Yahoo Maps Services, Geocoder.us and Geocoder.ca services, but it is easily extensible and I can almost any services there. So, if you know some other services, that providing longitude/latitude pair by postal address, drop me a note and I will try to add its support to library.
[/lang_en]
[lang_ru]
Иногда нам бывает необходимо узнать геокод (geocode), соответствующий определенному почтовому адресу. Например, у Вас может быть каталог магазинов и вы хотите показывать расположение конкретных магазинов на карте. Стандартным решением является запрос к каким-либо geocoding-сервисам, которые выдадут вам широту и долготу указанного вами адреса для изображения маркеров на карте. Но, если geocode-сервис не доступен или не сможет разобрать предоставленный ему адрес, то вы не сможете показать пользователям карту. 🙁 Для решения данной проблемы я написал небольшой модуль на PHP, который помогает мне получать надежные результаты в большинстве случаев просто используя несколько различных geocoding-сервисов.
На данный момент модуль умеет использовать Google Maps API, Yahoo Maps Services, Geocoder.us и Geocoder.ca, но он легко расширяем и потому я могу добавить туда практически любой другой источник данных. Поэтому, если вы знаете какие-либо сервисы, способные предоставить широту и долготу по указанному почтовому адресу, сообщите мне и я буду раз добавить поддержку этого сервиса в библиотеку.
[/lang_ru]
[lang_en]
This article is part of “Looking For Optimal Solution” series, devoted to testing various Ruby On Rails deployment schemes and doing some simple benchmarks on these schemes. General idea of testing is to find subset of most optimal RoR deployment schemes for different situations.
This small article is about Rails+Mongrel setup and its performance. List of other tested deployment schemes, description of testing methodology and, of course, all benchmark results you can find on “Ruby On Rails Benchmark Summary and Findings” page.
[/lang_en]
[lang_ru]
Эта статья является частью серии “В поисках оптимального решения“, посвященной тестированию производительности различных схем развертывания приложений на Ruby On Rails. Основной идеей тестирования является поиск подмножества самых оптимальных с точки зрения производительности решений по установке RoR-приложений в различных ситуациях.
Эта небольшая статья посвящена установке связки Rails+Mongrel и ее производительности. Список всех протестированных схем развертывания, описание методики тестирования и результаты всех тестов вы можете найти на странице “Результатов и Выводов“.
[/lang_ru]
Read the rest of this entry →
[lang_en]
Aftrer my previous post about high-performance RoR deployment methods, I’ve got lots of messages/emails/IM conversations about some errors in previous benchmarks and there were lots of suggestions about extending of tested software set and modifying testing methodology. So, that is why I decided to perform deep and wide performance testing for all deployment schemes I can find. In this article you can find description of testing methodology and, of course, benchmarks results. If you want to know details of specific software setup, take a look at articles in category “Ruby On Rails” to find all articles from “Looking for optimal Solution” series (I’ll post all of them in next few days).
[/lang_en]
[lang_ru]
После выхода моей предыдущей статьи о методах высокопроизводительной настройки проектов на RoR, я получил море сообщений/писем и поговорил с кучей народу через IM и многие сообщения касались логических или методических ошибок в процессе тестирования или содержали в себе просьбу расширить или изменить параметры тестирования. Именно поэтому я решил провести новое тестирование – более глубокое и намного более широкое в плане охвата различных решений. В этой статье Вы сможете ознакомиться с методикой тестирования и, конечно же, с результатами проведенных тестов. Если Вас интересуют детали настройки ПО в отдельных тестах, Вы можете заглянуть в раздел сайта, посвещенный “Ruby On Rails” и прочесть отдельные сообщения из серии “В поисках оптимального решения” о каждом из тестировавшихся подходов к запуску rails-приложений (статьи о конфигурации будут готовы в течение ближайших нескольких дней).
[/lang_ru]
Read the rest of this entry →