Skip to content

A nginx module to learn about using built-in data structures in shared memory zone

Notifications You must be signed in to change notification settings

ykaya932/ngx-shm-data-structures-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NGINX DATA STRUCTURES IN SHARED MEMORY MODULE

Introduction

This is a module that I tried to understand the usage of builtin data structures and using them in the shared memory zone.

Requests are in the following format:

http://localhost/a_digit/a_number/

For each a_digit value rbtree is checked, if there isn't any node with a_digit value a new node is created. Then a_number is added to the hash table that is inside the newly created or existing rbtree node.

Since every request needs shared memory to be saved, all of the operations are done in shared memory zone.

nginx.conf File

I have used the following lines in my conf file:

    server {
        listen       80;
        server_name  localhost;
        
        location = /tree{
            print-tree;
        }
        location ~ ^/\d/\d+$ {
            insert;
        }
    }

Helpful Links

I have learned many things from Emiller's Guide. It is very nice guide for beginners.

Also I have got help from nginx-hello-world-module. It was nice to see a whole module code.

And for data structures and shared memory, I often checked the developement guide written by nginx developers.

About

A nginx module to learn about using built-in data structures in shared memory zone

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages