All Projects → AstRonin → sgi

AstRonin / sgi

Licence: other
Socket Gateway Interface

Programming Languages

erlang
1774 projects

Projects that are alternatives of or similar to sgi

fano
Pascal web application framework
Stars: ✭ 21 (+31.25%)
Mutual labels:  uwsgi, fastcgi
Meteor-Mailer
📮 Bulletproof email queue on top of NodeMailer with support of multiple clusters and servers setup
Stars: ✭ 21 (+31.25%)
Mutual labels:  cluster, balancer
Cutelyst
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
Stars: ✭ 671 (+4093.75%)
Mutual labels:  uwsgi, fastcgi
k8s-lemp
LEMP stack in a Kubernetes cluster
Stars: ✭ 74 (+362.5%)
Mutual labels:  cluster, fastcgi
Azure-AKS-ApplicationGateway-WAF
No description or website provided.
Stars: ✭ 16 (+0%)
Mutual labels:  cluster
django-setup
Setup Django application with Nginx and uWSGI on a Ubuntu server
Stars: ✭ 12 (-25%)
Mutual labels:  uwsgi
torxy
Rules-based transparent HTTP/HTTPS proxy for the TOR server.
Stars: ✭ 24 (+50%)
Mutual labels:  tor
cpplipa
C++ library package
Stars: ✭ 17 (+6.25%)
Mutual labels:  fastcgi
is-osm-uptodate
Find outdated nodes in OpenStreetMap
Stars: ✭ 16 (+0%)
Mutual labels:  uwsgi
hekate
Java Library for Distributed Services
Stars: ✭ 17 (+6.25%)
Mutual labels:  cluster
youtube rss
A YouTube-client for managing subscriptions and watching videos anonymously over Tor without a Google account.
Stars: ✭ 49 (+206.25%)
Mutual labels:  tor
eks-with-istio
Terraform template for a production ready EKS Cluster and ISTIO Service Mesh 🐳 📦 🚀
Stars: ✭ 32 (+100%)
Mutual labels:  cluster
elza
Private, fast and minimal web browser based on electron with built-in tor.
Stars: ✭ 45 (+181.25%)
Mutual labels:  tor
spatialcluster
spatially-constrained clustering in R
Stars: ✭ 25 (+56.25%)
Mutual labels:  cluster
Chaincase
The only privacy preserving bitcoin app on iOS
Stars: ✭ 55 (+243.75%)
Mutual labels:  tor
HomePage
Python Django开发管理后台+Bootstrap响应式网站
Stars: ✭ 32 (+100%)
Mutual labels:  uwsgi
docker-swarm-vagrant
Getting started with Docker swarm
Stars: ✭ 20 (+25%)
Mutual labels:  cluster
qubes-app-split-browser
Tor Browser (or Firefox) in a Qubes DisposableVM, with persistent bookmarks and login credentials
Stars: ✭ 33 (+106.25%)
Mutual labels:  tor
tornote
Self-destructing notes on Go with tiny secured client-side
Stars: ✭ 28 (+75%)
Mutual labels:  tor
aws docker swarm
setup to bootstrap docker swarm cluster and a controller on AWS using terraform
Stars: ✭ 24 (+50%)
Mutual labels:  cluster

SGI - Socket Gateway Interface

Application is written on Erlang. General design principles are: fast, low memory and modularity.

SGI gives possibility simple and smart way to connect to any server by TCP and has other protocols working under TCP. It supports two protocols:

  • FastCGI. This protocol is common for connect to PHP (FPM).
  • uwsgi. This protocol is the native protocol used by the uWSGI server. See 3-th sample for more details.

Socket Client

Includes Balancer and Pool, is an importent component of the app. It can connect to any number of servers. It is flexible and easily configurable. If server has down then Balancer will not send the requests and it some times will сheck server availability.

Balancer can open new connections as needed on the fly and starts with a small necessary quantity of connections. If some socket will not use some time then this socket will be closed freeing memory.

Balancer has two balancing methods: blurred and priority. Please look to Sample 4 to get an idea of the advantages of each. It will allow to configure Socket Client for different server architectures.

Proxy

Application be able to create connect through the proxy, now support SOCKS5 protocol, and you can send message, for example through the Tor. @see Configuration section.

Base components

Requirements

  • Erlang 18.1+

Documentation

Read documentation in Wiki.

Upgrade

Read UPGRADE before installation new version.

Try Samples

Sample 1 - Add a content from other languages inside of your Site.

This sample shows you how you can add "Busines Logic" (big or old) to your site using PHP files.

It is based on the sample from n2o.

$ git clone git://github.com/astronin/sgi
$ cd sgi/samples
$ ./mad deps compile plan
$ ./mad repl

Run php as fcgi server:

$ sudo service php5-fpm start

Now you can try it out: http://localhost:8000

Sample 2 - Your whole common site after erlang server and WebSocket instead of Ajax.

This sample shows you how you can run your site (written in other PL) with support of WebSocket. Forget about Ajax and do your page much more faster.

You have the following advantages compared to Ajax even in common web page:

  • Fast
  • Low overhead, especially over https
  • Easy forwarding a file
  • Saving CPU resources of both a client and a server
Setup:
$ git clone git://github.com/astronin/sgi
$ cd sgi/samples

Change app in rebar.config:

$ vim samples/apps/rebar.config

{sub_dirs, [ "review" ]}. -> {sub_dirs, [ "review2" ]}.

Change app in sys.config:

{n2o, [{app,review2}]}

Run FPM:

$ sudo service php5-fpm start

Run Server:

$ ./mad deps compile plan
$ ./mad repl

Url: http://localhost:8000/site.php

Sample 3 - Like Sample 2, but using Python.

This sample shows you how you can run your site (wrote in Python and support uwsgi protocol) with support of WebSocket. For this you need to use server uWSGI.

Setup:
$ git clone git://github.com/astronin/sgi
$ cd sgi/samples

Change app in rebar.config:

$ vim samples/apps/rebar.config

{sub_dirs, [ "review" ]}. -> {sub_dirs, [ "review3" ]}.

Change app in sys.config:

{n2o, [{app,review3}]},
{sgi, [{servers, [
    [{name, default}, {address, localhost}, {port, 3031}]
]}]}

Run uWSGI:

$ uwsgi --socket 127.0.0.1:3031 --wsgi-file <your path clone>sgi/samples/cgi-scripts/python/myapp.py

Run Server:

$ ./mad deps compile plan
$ ./mad repl

Url: http://localhost:8000/

Sample 4 - Part of socket connection

This sample shows you how you can use TCP Client of this app. Thanks to the smart balancer Client can connect to any number of servers in different methods: priority or blurred.

Setup:
$ git clone git://github.com/astronin/sgi
$ cd sgi/samples

Change app in rebar.config:

$ vim samples/apps/rebar.config

{sub_dirs, [ "review" ]}. -> {sub_dirs, [ "review4" ]}.

Change app in sys.config:

{n2o, [{app,review4}]}

Change following settings in sys.config. Sample will start 10 servers with 5 processes. Client will connect with 5 sockets on each server.

{servers, [
    [{name, default}, {address, localhost}, {port, 10000}, {timeout, 60000}, {weight, 10}, {start_connections, 4}, {max_connections, 5}, {max_fails, 5}, {failed_timeout, 60}],
    [{name, aaa1},    {address, localhost}, {port, 10001}, {timeout, 60000}, {weight, 9},  {start_connections, 4}, {max_connections, 5}, {max_fails, 5}, {failed_timeout, 60}],
    [{name, aaa2},    {address, localhost}, {port, 10002}, {timeout, 60000}, {weight, 8},  {start_connections, 4}, {max_connections, 5}, {max_fails, 5}, {failed_timeout, 60}],
    [{name, aaa3},    {address, localhost}, {port, 10003}, {timeout, 60000}, {weight, 7},  {start_connections, 4}, {max_connections, 5}, {max_fails, 5}, {failed_timeout, 60}],
    [{name, aaa4},    {address, localhost}, {port, 10004}, {timeout, 60000}, {weight, 6},  {start_connections, 4}, {max_connections, 5}, {max_fails, 5}, {failed_timeout, 60}],
    [{name, aaa5},    {address, localhost}, {port, 10005}, {timeout, 60000}, {weight, 5},  {start_connections, 4}, {max_connections, 5}, {max_fails, 5}, {failed_timeout, 60}],
    [{name, aaa6},    {address, localhost}, {port, 10006}, {timeout, 60000}, {weight, 4},  {start_connections, 4}, {max_connections, 5}, {max_fails, 5}, {failed_timeout, 60}],
    [{name, aaa7},    {address, localhost}, {port, 10007}, {timeout, 60000}, {weight, 3},  {start_connections, 4}, {max_connections, 5}, {max_fails, 5}, {failed_timeout, 60}],
    [{name, aaa8},    {address, localhost}, {port, 10008}, {timeout, 60000}, {weight, 2},  {start_connections, 4}, {max_connections, 5}, {max_fails, 5}, {failed_timeout, 60}],
    [{name, aaa9},    {address, localhost}, {port, 10009}, {timeout, 60000}, {weight, 1},  {start_connections, 4}, {max_connections, 5}, {max_fails, 5}, {failed_timeout, 60}]
]},
{balancing_method, priority}, %blurred or priority

Run Server:

$ ./mad deps compile plan
$ ./mad repl

Change in sys.config next {balancing_method, blurred},

$ ./mad repl

Sample will create the two files: server_distribution(priority).csv and server_distribution(blurred).csv which shows difference between two methods of connection balancing to a server. Open files in Excel(or other) and insert XY(Scater) graph:

priority Below are results with next weights:

Server port Weight
10000 1
10001 2
10002 3
10003 4
10004 10
10005 9
10006 8
10007 7
10008 6
10009 5
priority
priority
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].