• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Tuning OpenStack Server Instance (Ubuntu, HP Cloud)

By Abhishek Ghosh March 20, 2015 8:11 am Updated on March 20, 2015

Tuning OpenStack Server Instance (Ubuntu, HP Cloud)

Advertisement

Tuning OpenStack Server Instance Can Give Better Networking Performance and Better Security. Example is Given With Ubuntu Server on HP Cloud. As basically we work with virtual machines, stability of an instance is far lesser than a real machine. We have to compromise between performance and stability by trial and error method. The best way to exert a server load is to assign it to a dev domain and purchase cheaper real human traffic. This is practical and real life test and monitor the resource consumption, log files etc. No tool basically can emulate the real world situation. This Guide For Tuning OpenStack Server Instance is Intended For The Advanced Users Only. We are taking it granted that MySQL or any other database is running on separate server, we are tuning a Nginx webserver running PHP5-FPM, XCache with WordPress as Frond End web software. You are spinning up an instance from latest manual OpenStack Snapshot.

 

Tuning OpenStack Server Instance (Ubuntu, HP Cloud) : TCP

 

Default allocated TCP buffer sizes for Linux too small. We can know the value by running this command :

Vim
1
cat /proc/sys/net/ipv4/tcp_mem

For a 4 GB instance, this will give this kind of value :

Advertisement

---

Vim
1
94638126184189276

First we are providing you the commands with cat to get your default values. You can keep them as record, do the changes by editing the file, reload the sysctl.conf to to reflect the changes.

Vim
1
2
3
4
5
6
7
8
# socket memory
cat /proc/sys/net/core/rmem_default
cat /proc/sys/net/core/rmem_max
# send socket memory
cat /proc/sys/net/core/wmem_default
cat /proc/sys/net/core/wmem_max
# buffer
cat /proc/sys/net/core/optmem_max

We have to edit the file – /etc/sysctl.conf and then reload it by running sysctl -p command. Open with Nano :

Vim
1
nano /etc/sysctl.conf

There are many commented out lines. First, it is better to search with parameter within the file with ^ + W search function. If the line is not present, add it at the end of the file, write out and reload. These are the directions to be added.

Vim
1
2
3
4
5
6
7
8
9
net.core.wmem_max=12582912
net.core.rmem_max=12582912
net.ipv4.tcp_rmem= 10240 87380 12582912
net.ipv4.tcp_wmem= 10240 87380 12582912
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_no_metrics_save = 1
net.core.netdev_max_backlog = 5000

These are more than enough.

 

Tuning OpenStack Server Instance (Ubuntu, HP Cloud) : /proc filesystem

 

We have to edit the file – /etc/sysctl.conf and then reload it by running sysctl -p command. Open it with Nano and here is a sample parameters :

Vim
1
2
3
4
5
6
7
net.ipv4.ip_forward = 1
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

These are direct changes to VM (memory) subsystem. We could use the command sysctl to view and temporarily edit the values. In that case, when we would reboot, the changes would go away. As our instance itself is a snapshot, we can play without going through so many steps. Grammatically, that is the correct method for a Physical Machine.

Tuning-OpenStack-Server-Instance-Ubuntu-HP-Cloud)

 

Tuning OpenStack Server Instance (Ubuntu, HP Cloud) : Security and the Full File

 

This is a sample /etc/sysctl.conf file :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.default.log_martians = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.ip_forward = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
kernel.exec-shield = 1
kernel.randomize_va_space = 1
# HP Cloud has no IPv6
# net.ipv6.conf.default.router_solicitations = 0
# net.ipv6.conf.default.accept_ra_rtr_pref = 0
# net.ipv6.conf.default.accept_ra_pinfo = 0
# net.ipv6.conf.default.accept_ra_defrtr = 0
# net.ipv6.conf.default.autoconf = 0
# net.ipv6.conf.default.dad_transmits = 0
# net.ipv6.conf.default.max_addresses = 1
# HP Cloud has no IPv6 above kept for future
fs.file-max = 65535
kernel.pid_max = 65536
net.ipv4.ip_local_port_range = 2000 65000
net.ipv4.tcp_rmem = 4096 87380 8388608
net.ipv4.tcp_wmem = 4096 87380 8388608
net.core.rmem_max = 8388608
net.core.wmem_max = 8388608
net.core.netdev_max_backlog = 5000
net.ipv4.tcp_window_scaling = 1

 

Tuning OpenStack Server Instance (Ubuntu, HP Cloud) : Nginx Specific

 

These are applicable to either /etc/nginx/nginx.conf or /etc/nginx/sites-available/default (for one domain, one server setup) :

Vim
1
2
3
4
5
6
7
# session and simultaneous connections for a session
limit_zone slimits $binary_remote_addr 5m;
limit_conn slimits 5;
# Edit it, request to Host is only allowed
      if ($host !~ ^(thecustomizewindows.com|www.thecustomizewindows.com)$ ) {
         return 444;
      }

These are usually maximum. Hotlinking images sucks resources but also give a feeble backlink. For SEO reasons, it is better to allow some method. It is better to use CORS header and configure CDN to block the usage of CSS and Javascript by the others.

Tagged With rmem_max openstack , tuning cloud server
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Tuning OpenStack Server Instance (Ubuntu, HP Cloud)

  • sysctl.conf Tweaking In OpenVZ Virtual Server Instance

    OpenVZ Kernel Offers A Conservative and Stable Kernel. Here Is Some Information On sysctl.conf Tweaking In OpenVZ Virtual Server Instance.

  • How To Add IPv6 to IPv4 Server With Nginx Reverse Proxy

    Some Dedicated Server May Not Have IPv6. Here is How To Add IPv6 to IPv4 Server With Nginx Reverse Proxy and Cloud Server Instance With IPv6.

  • IPv4 to IPv6 : Adoption and Abandonment

    With the end of the IPv4 blocks, one would think that the adoption of IPv6 is near. In reality it is not so, and it is really far from that situation.

  • HP Cloud IPv6 : Method to Use on Instances

    One of the commonly asked question is around HP Cloud IPv6. At the time of publication of this guide there is no official way except DIY methods.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy