why are there so many youtube videos about deploying a dockerized version of nginx. why do you need docker to deploy fucking nginx

is using your fucking package manager too old school, now.

in one video somebody had listed their docker images and their nginx image was over a hundred fucking megabytes. nginx is tiny!!! what the fuck do you need a hundred megabytes FUR???

nginx uses less than 10 megs of ram on my servers!!! it’s small!!!!! it has few dependencies!!!! just run it!!!!!!

@aescling Stupid question: How to measure how much RAM a program uses?

@vaporeon_ that is hard to do well because purrograms commonly allocate way more memory than they actually ever use (idk how this really works tbh but the kernel does a lot of magic here). htop will give you reasonable enough answers. if your purrogram is being supervised by systemd, systemctl status will tell you current and peak memory usage but idk what exactly it is calculating

@aescling > idk how this really works tbh but the kernel does a lot of magic here

In a lecture that I attended, I was told that it uses something called "first touch policy", where only once the program actually accesses a page of memory, the kernel actually backs it by a page of physical memory (and for a system with NUMA and multiple cores, it'll choose to locate the page closest to the processor that touched it!)

For a practical test, I ran this program (after getting bored of trying to find the maximum value manually; the size of memory + swap on my system is 12'713'656'320 bytes):

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main() {
size_t i = 12713656300;
char *p;
while (p = malloc(i)) { free(p); i++; }
printf("%zu\n", i-1);
return 0;
}

And I can allocate up to MEM+SWAP-21 bytes before malloc() starts returning a NULL pointer!

If I sleep for 60 seconds with all that memory allocated, still, it doesn't affect my system at all, since I didn't actually touch that memory, so it doesn't need to be backed by a physical page

@aescling Also, you should be already aware at this point that Vaporeon doesn't use systemd LOL

Especially since the Apache process that I wanted to measure runs on NetBSD

Follow

@vaporeon_ yeah i know, i’m just saying how i specifically know how much memory nginx uses on “my” servers

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.