2021/12/21 PHPerKaigi petit - PHP8.1リリース祝賀会 でのトーク「モダンPHPテクニック 12選 ―PsalmとPHP 8.1で今はこんなこともできる!―」のスライドです。発表時点からごくわずかに加筆修正した部分があります。 https://phperkaigi.connpass.com/event/233022/
![Using ngx_lua / lua-nginx-module in pixiv](https://cdn-ak-scissors.b.st-hatena.com/image/square/ea979e24a0045d64770102ae55ce7542bbc11cf7/height=288;version=1;width=512/https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fngx-luapublic-130716204423-phpapp02-thumbnail.jpg%3Fwidth%3D640%26height%3D640%26fit%3Dbounds)
Nginx just became the most used web server among the top 1000 websitesPosted by Matthias Gelbmann on 3 July 2013 in News, Nginx, Web Servers Summary: 34.9% of the top 1000 web sites rely on Nginx. That makes it the most trusted web server on high traffic sites, just ahead of Apache. The Russian Nginx has a reputation of being a fast and reliable web server. High traffic sites all over the world in
アプリケーションでどうしても捌けない量のリクエストが一時的に押し寄せてしまう場合、アプリケーションサーバが死ぬのを避けるために GET は制限を掛けたいが、POST はリトライが面倒なのでなるべく通してあげたい、というような要求を nginx で処理できるかどうか。 実装として一番望ましいのは GET は 100 req/sec で制限 (超えたら503) POST は無制限 のようにメソッドごとに別々の制限を掛けることだったのですが、とりあえず HttpLimitReqModule を使うことで、メソッドごとに同一の上限を設定することはできました。 http { limit_req_zone $request_method zone=method:1m rate=100r/s; server { listen 80; location / { limit_req zone=method;
nginx documentationIntroduction Installing nginx Building nginx from Sources Beginner’s Guide Admin’s Guide Controlling nginx Connection processing methods Setting up hashes A debugging log Logging to syslog Configuration file measurement units Command-line parameters nginx for Windows Support for QUIC and HTTP/3 How nginx processes a request Server names Using nginx as HTTP load balancer Configur
nginxでproxy_cache_pathにしているkey_zoneのサイズはどのくらいにすれば良いのか。 nginxでプロキシキャッシュを使う場合はnginx_cache_pathにパスや容量などを指定する事になる。 proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=CACHE:512m inactive=1d max_size=60g; このときkeys_zoneには共有メモリの名前と容量を指定するのだが、この容量は結局の所幾らにすればよいのか。引用すると次のようになるらしい。 Zone size should be set proportional to number of pages to cache. The size of the metadata for one page (file) depends on
Discover install links, docs, and support options for open source server modules that optimize your site automatically.
ngx_mrubyに対しても、mod_mrubyで実装していたような高速化アーキテクチャ(これとかこれ)を実装することができたので、どれくらいのパフォーマンスがでるのかをngx_mrubyとmod_mrubyで比較してみました。 mod_mrubyとngx_mrubyのインストール gitからそれぞれのコードを落としてきて、以下のようにコンパイルしました。 git clone git://github.com/matsumoto-r/mod_mruby.git cd mod_mruby git submodule init git submodule update cd mruby git checkout master rake cd .. ./configure make sudo make install git clone git://github.com/matsumoto-r/
By Evan Miller (with Grzegorz Nosek) DRAFT: August 13, 2009 Whereas Emiller’s Guide To Nginx Module Development describes the bread-and-butter issues of writing a simple handler, filter, or load-balancer for Nginx, this document covers three advanced topics for the ambitious Nginx developer: shared memory, subrequests, and parsing. Because these are subjects on the boundaries of the Nginx universe
nginx.org Popular high performance HTTP server. Event based (asynchronous) architecture. Low and predictable memory footprint. Declarative configuration language. Extendable with modules written in C. OpenResty = Nginx + a collection of modules. In production for large e-commerce sites in China (Alibaba Group). Non-blocking I/O using Nginx modules, including: Memcached Redis MySQL / Drizzle Postgr
はい、これは僕がいつも良く見るApacheとNginxの性能差に見えます。大体、ApacheはNginxの75%程度の性能に落ち着きます。数十バイトの静的コンテンツに対するリクエスト処理はNginxの得意分野だと思っていたので、大体こんなものです。 そこで、真面目にevent_mpmのチューニングを行ってみました。で、幾度となくベンチを試した結果導き出した、静的コンテンツに対する同時接続数100程度に対して最高のパフォーマンスを示すevent_mpmの設定は以下のようになりました。 [program lang=’apache’ escaped=’true’] StartServers 4 MinSpareThreads 4 MaxSpareThreads 4 ThreadsPerChild 2 MaxRequestWorkers 2 MaxConnectionsPerChild 0 [/p
The Architecture of Open Source Applications (Volume 2) nginx Andrew Alexeev nginx (pronounced "engine x") is a free open source web server written by Igor Sysoev, a Russian software engineer. Since its public launch in 2004, nginx has focused on high performance, high concurrency and low memory usage. Additional features on top of the web server functionality, like load balancing, caching, access
Nginx uses an event-driven architecture with a master process that manages worker processes. It handles requests non-blockingly and efficiently using techniques like memory pooling, buffer chaining, and an event-driven model. Key parts of the architecture include phases and handlers for HTTP requests, virtual servers, locations, and filters. Nginx also supports mail proxying and module development
Captcha security check zhuzhaoyuan.com is for sale Please prove you're not a robot View Price Processing
locationディレクティブはパスの条件が評価されて選ばれたものが適応されます。この条件はパスの文字列の前方一致あるいは正規表現による評価です。この評価の順番は以下のようになります。 前方一致("=", "^~", プレフィックスなし)の条件の評価を実施 最も一致する条件を選ぶ。 選ばれた条件が、完全一致で、プレフィックスが"="であれば、そこで評価を終了し、そのlocationディレクティブを適応する。 選ばれた条件のプレフィックスが"^~"であれば、そこで評価を終了して、そのlocationディレクティブを適応する。 正規表現("~", "~*")の条件の評価を実施 正規表現の条件を設定ファイルに定義した順番に評価する。一致したら、そこで評価を終了して、そのlocationディレクティブを適応する。 前方一致の評価で選ばれた条件のlocationディレクティブを適応する。 ここで注意
Emiller’s Guide To Nginx Module Development By Evan Miller First published: April 28, 2007 (Last edit: August 11, 2017 – changes) Bruce Wayne: What’s that? Lucius Fox: The Tumbler? Oh… you wouldn’t be interested in that. To fully appreciate Nginx, the web server, it helps to understand Batman, the comic book character. Batman is fast. Nginx is fast. Batman fights crime. Nginx fights wasted CPU cyc
方針 手元(Ubuntu)で開発して、サーバ(Ubuntu)にデプロイ出来るrails 3.1動作環境を作るのが目標 プロジェクト毎にユーザを作成する (各ライブラリをプロジェクト毎にbundlerで管理、デプロイをするため) 同様の理由でrbenvを使って各ユーザ毎にrubyのバージョンを管理 構成 静的なファイルへのリクエストは直接nginxで返す構成をとります(railsのpublic配下のディレクトリにあるファイル、適宜nginxのconfigに設定を追加する必要あり)。またrails3.1からAsset Pipelineが導入されたため/assets/〜に関するリクエストに関してもnginxで直接返すようにします。加えてnginx <=> unicorn間の接続にはUnix Domain Socketを用います。イメージを図にすると下記のようになります。 unicorn gith
Apacheモジュール作成は以前のエントリの通り手軽に出来ます。 Apacheモジュールの作成とgdbとloggerでのデバッグ方法 - よねのはてな 今回は、Nginxでモジュール作成してみたいという人向けです。 Nginxにおける処理の流れと押さえておきたい構造体、モジュール作成方法をのせておきます。 Nginx http://nginx.net/ そもそもNginxってなんだ?という人は軽量超高速なHTTPサーバという理解でOKです。 実際にはReverse Proxy、Mail Proxyとしても使用可能で、ライセンスはNSD系。 Nginxについては以下を参照下さい。 パフォーマンス比較 http://www.joeandmotorboat.com/2008/02/28/apache-vs-nginx-web-server-performance-deathmatch/ Ngin
Whether you have installed Nginx using the package manager or from source, you will need to look at the main configuration file and see what may need changing and optimising. Although I'll make some suggestions, the aim is not to change a great deal at this point. Rather, we will look at the main settings, see what they mean and what a change will actually do. Defaults So why only a few changes to
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く