|
|
|
|
|
by lukatmyshu
5954 days ago
|
|
(expanding on this) nginx uses a buffer-chain architecture internally. This means that if your data comes in chunks when you read it in (remember, nginx is event based) then it's stored internally in fragments that correspond to those reads. Almost all the operations on it work on those chains so often times the data never has to be copied until it's written (I believe using iovectors) back out.
Memory is managed in request pools which minimize memory fragmentation, and are just faster/safer than calling malloc/free directly. |
|