Серьезно ускоряя PHP?

Просто звоните, это

> a

Удостоверяется, что это будет найдено (соединяют каналом).

8
задан Lee Benson 21 November 2009 в 08:49
поделиться

6 ответов

Я думаю, вам стоит попробовать memcached , если вы говорите о кешировании данных. Я думаю, что PHP достаточно опытен в кешировании скомпилированных php-страниц, если вы используете такие вещи, как mod_php в apache (который не умирает между запросами).

9
ответ дан 5 December 2019 в 08:24
поделиться

Взгляните на APC (альтернативный кеш PHP) , он хранит кеш скомпилированных файлов (код операции PHP), а также позволяет сохранять случайные переменные в памяти с помощью apc_fetch, apc_store.

Установка очень проста и действительно повышает производительность.

8
ответ дан 5 December 2019 в 08:24
поделиться

Create a full page cache on the ram disk and make your web server serve the page from there. This is a method that wordpress supercache plugin uses and it works great if your web site is suitable for full page caching. This whay you are not even invoking the PHP interpreter.

For users that are logged in (have an open session) you can create a rewrite condition that will redirect their request to the PHP engine.

Also, always use an opcode cache like APC and use it for caching config files (memcache is also fine).

2
ответ дан 5 December 2019 в 08:24
поделиться

Regarding your last question, I believe at least most of the Python and Ruby web frameworks work like that.

Ruby web applications are nowadays built so that the app is only initialized once per server process. When requests come in, the server (Apache, for example) passes them to the web application (over Rack interface) which is running on the background.

This is how web frameworks based on Rack work. Older versions of Ruby on Rails were similar, although they used a different interface to talk to the web server.

0
ответ дан 5 December 2019 в 08:24
поделиться

If you are asking for a JVM/Tomcat like application server, then the answer is likely no. To my knowledge nothing (usable) like this exists for PHP. PHP uses a shared-nothing architecture, so it is by design everything is setup on all requests. But actually, this makes PHP scale pretty well.

As for speeding up your apps, try to use memcached and a code accelerator. Maybe look into Zend Server to get a complete package.

1
ответ дан 5 December 2019 в 08:24
поделиться

Я бы постоянно следил за страницей инженеров Facebook ( http://www.facebook.com/notes.php?id=9445547199 ), затем они придумывают сообщения о том, как они ускоряют работу / оптимизируют / масштабируют. Я считаю, что использование php очень впечатляет.

0
ответ дан 5 December 2019 в 08:24
поделиться
Другие вопросы по тегам:

Похожие вопросы: