Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: nginx global setting

  1. #1
    Join Date
    Jul 2020
    Beans
    8

    Lightbulb nginx global setting

    Hi. We are new to managing the Linux Server (Ubuntu 20.04) and are hoping that someone can enlighten us about what settings that we can make so our application can run smoothly on both our server and the application that we developed. So here are the specifications of the server and the application information:

    Ubuntu Server 20.04
    1TB SAS Raided
    64gb RAM (16 cores)

    Running there is a administrator website for a mobile application which is a time in and a time our for our employees with a geolocation coordinates and a picture to be uploaded.

    For now the application with the website are only consuming 1gb of our ram and wanted to maximize the use of our server. And another problem is that for some reason the server cant smoothly run the time in and time out of more than 5 thousand employees simultaneously and is freezing. Can someone help us what settings can we do with our nginx or any other settings that can help us with our problems especially when it comes to www.conf, nginx.conf etc.

    Thank you in advance.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    20,460
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: nginx global setting

    Why not try using apache? See how useful that suggestion is?

    Sounds like you need a professional engagement by an expert in app tuning, server tuning, monitoring and alarming. if there is a DBMS, may need a DB tuning expert too.

    RAM use is just one possible bottleneck. Need to look a network and disk I/O, wait states, caching, CPU, and optimize the session data as much as possible.

    is all the traffic good or can some be nefarious that should be blocked?

  3. #3
    Join Date
    Jul 2020
    Beans
    8

    Re: nginx global setting

    Good day! Brother TheFu.

    Is Apache better than Nginx?

    Yes professional tuning is what we need right now. Can you suggest a settings that we can use for now?

    Yes all traffics are good and nothing should be blocked.

  4. #4
    Join Date
    Sep 2011
    Location
    Behind you!
    Beans
    1,358
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: nginx global setting

    Well, depending on the app, web servers have a simultaneous connectivity limit. If you are running a single web server, you might want to change that up a bit.

    In your description of the server, you left out a lot of details...the very-most important being your network capability. Are you utilizing a single NIC? Is it a 100 mbit card or 1000 bit or is it fiber?

    When setting up a web server for high-availability (especially for bandwidth), you need a design that exceeds your expectations (because growth is rarely downward).

    If you only have a single server, you are fairly limited in your options, however, it is likely you can benefit from virtualization. Install a hypervisor on the server so you can run multiple virtual servers which seems like a good idea since you have the RAM and CPU capability.

    Here is a design that would allow adding multiple web servers and databases easily to compensate for any needed capability however it is likely overkill in your scenario but it can be adjusted to your needs. It is something to think about. I also have detailed instructions you can go through for each component if you want to look through them.


    Please don't forget about having a backup server that can take over if the primary goes offline or at least just a destination for backups to exist so you can restore your server(s) in a disaster.

    LHammonds
    Last edited by LHammonds; 3 Weeks Ago at 02:49 PM.

  5. #5
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    20,460
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: nginx global setting

    Quote Originally Posted by dyoms View Post
    Is Apache better than Nginx?
    Sometimes. "It depends" is the only answer. Are there things that nginx cannot be tuned to accomplish that apache can?

    Quote Originally Posted by dyoms View Post
    Yes professional tuning is what we need right now. Can you suggest a settings that we can use for now?
    Changing settings without facts is counter productive. Gather the facts first. Determine what is performing below accepted values and tweak those things one at a time. Gather the facts again for the entire solution to see if those tweaks helped or hurt. If they helped, now there is a new bottleneck to be addressed. Do those steps over and over and over based on the data and facts. There's no magic setting here. You have to do the work ..... or pay someone else to do it.

    Further, it may be good enough after the first few iterations, but once you have someone (or a company) engaged, you probably want to free up as many bottlenecks as possible. Early things found can be 10% or 500% improvements or more. Probably need to go through at least 1 round of fixing bottlenecks for each of the main areas before stopping.

    Be certain your developers pay attention and learn.
    Be certain your network and systems admins also pay attention and learn. Or in 5-10 months, you'll be back with similar problems again.

    Quote Originally Posted by dyoms View Post
    Yes all traffics are good and nothing should be blocked.
    I find that nearly impossible to believe for any system on the internet. Just today, I've seen over 10,000 attacks, mostly useless, against my network. They are mostly useless because I've spent the time to look at the requested URLs and block access to all admin URLs from non-company subnets. Saw a few guacamole attacks today.

  6. #6
    Join Date
    Jul 2020
    Beans
    8

    Re: nginx global setting

    thanks for the reply bro Lhammonds

    we can provide another 2 or 3 servers but the specifications are not as the main server. we will try to do this as you instructed for some uploads are still slow after computing the settings and then adjusted.

    Yes we are utilizing a single nic and has a 1000mbit capability.

    do you have a guide on how to set up 3 nodes with 3 servers not virtual. it will be much appreciated.
    Last edited by dyoms; 3 Weeks Ago at 04:11 AM.

  7. #7
    Join Date
    Jul 2020
    Beans
    8

    Re: nginx global setting

    Bro TheFu

    one of my colleagues suggested we use nginx so i dont know really. and ooh ive been computing some settings and it actually makes a difference on how our website loads like 10x better now after doing some minor global settings.

    and yep i dont think someone would spend a lot of time hacking a small attendance system right. well we would be delighted to learn some counter for those attacks. honestly, we are really a newborn baby here in ubuntu/linux. trying to learn and really grateful to you guys who take time to help us with our concerns. anyways will try brother Lhammonds method and we will see where itll get us. will update soon.

  8. #8
    Join Date
    Sep 2011
    Location
    Behind you!
    Beans
    1,358
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: nginx global setting

    Quote Originally Posted by dyoms View Post
    we can provide another 2 or 3 servers but the specifications are not as the main server.
    I would still lay down a hypervisor on each server (such as Proxmox), even if you only plan to run a single virtual server on it. It would allow you the flexibility to add other VMs if desired and you can utilize virtual-based backup systems with snapshots. Just imagine having 4 physical servers, all setup as virtual hosts. You could have the HA configuration in the picture I showed where you could lose a single physical server (think failed hardware) and the whole system would continue to function....if you separated the sources correctly such as no server being a single point of failure (e.g. not having all the databases or web server or load balancers on it). You could test all this design out on a single machine using virtualization.

    Quote Originally Posted by dyoms View Post
    do you have a guide on how to set up 3 nodes with 3 servers not virtual. it will be much appreciated.
    When I documented how to setup a web and database server for high availability (like the image I showed you), I did so using Ubuntu Server 18.04. You can do the same thing with 20.04 but there will likely be small differences in specifics. The design is flexible though. You could setup two proxies (each on a different physical server) which load balance traffic to multiple web servers (two or more). You could have just a single database server with no HA option or you could split it into 5 servers for HA (2 proxy, 3 DB cluster nodes).

    Typically, the web app servers do not need to be super-beefy...you just need more of them. The database is typically what needs to be on a powerful server with lots of RAM.

    I don't have more time to go over all the potential variations but here is a list of tutorials I did for 18.04 which you can tailor to your needs:

    My tutorials assume the base server was setup following this template: How to Install and Configure an Ubuntu Server 18.04 LTS

    To setup a high-availability system:
    How to Install Apache Web Server on Ubuntu Server 18.04 LTS
    How to Install MariaDB Galera Cluster on Ubuntu 18.04 LTS
    How to Load Balance Apache Web Server on Ubuntu Server 18.04 LTS
    How to Load Balance Galera/MariaDB Servers on Ubuntu Server 18.04 LTS

    To setup a single web server and single database server:
    How to Install Apache Web Server on Ubuntu Server 18.04 LTS
    How to Install MariaDB 10.4.x on Ubuntu Server 18.04 LTS

    EDIT #1: If all I had was 4 physical servers total, I would setup the 10 virtual servers on 2 physical servers in such a way that one going offline will not take down the system. I would also make sure I had 2 UPS each going to a different electrical circuit. If the server has 2 power cables each, I would criss-cross them into each UPS to ensure best potential for uptime in a loss of power event. I would use the other two as remote backup targets and maybe even have them running some of the nodes in case one site goes completely dark, you can "still" stay online.

    EDIT #2: Keep in mind that I do not know your site or requirements and that the HA system may very-likely be complete overkill. However, it does allow the flexibility to scale out addition servers as needed with little fuss.

    EDIT #3: You "could" use just a single database instance and if you want to expand it to a cluster in the future, it shouldn't be too problematic. You could insert the DB load balancer's virtual IP as the old database's IP address that the web server(s) referenced so you could slide the cluster into use fairly easy and little downtime. So you could setup a couple web servers (with load balancer proxy front-ends) and utilize a single DB server at the beginning. Then increase the amount of web servers as needed and implement a DB cluster if needed later. Again, this is VERY trivial "if" you initially set it up as virtual machines...not so trivial if you installed directly onto a physical server.

    LHammonds
    Last edited by LHammonds; 3 Weeks Ago at 10:38 PM.

  9. #9
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    20,460
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: nginx global setting

    +1 on using VMs or at least Linux Containers.
    We stopped running servers directly on hardware around 2005. Since then, the servers running on physical computers are all VM hosts.

  10. #10
    Join Date
    Jul 2020
    Beans
    8

    Re: nginx global setting

    Thank you for these. Will do these and will let you know. BTW we are running NGINX instead of apache and mySQL instead of MariaDB.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •