Linux Speed, Responsiveness, and Latency Reduction
article #892, updated 1 day ago

On the vast majority of Linux distributions, one can add these changes to /etc/sysctl.conf, and then run sysctl -p to apply them without reboot. Very recently a few have omitted /etc/sysctl.conf by default, on these you can create /etc/sysctl.d/custom.conf and then run systemctl start systemd-sysctl. You can check your results with sysctl -A. These items help a lot in any application, including desktop, web server, or terminal server.

The first set is for wired networking performance:

net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_workaround_signed_windows=1
net.ipv4.tcp_sack=1
net.ipv4.tcp_fack=1
net.ipv4.tcp_low_latency=1
net.ipv4.ip_no_pmtu_disc=0
net.ipv4.tcp_mtu_probing=1
net.ipv4.tcp_frto=2
net.ipv4.tcp_frto_response=2
net.ipv4.tcp_congestion_control=illinois

A bit different first set for networking performance, is recommendable for anything involving wireless, i.e., “lossy” networks:

net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_workaround_signed_windows=1
net.ipv4.tcp_sack=1
net.ipv4.tcp_fack=1
net.ipv4.tcp_low_latency=1
net.ipv4.ip_no_pmtu_disc=0
net.ipv4.tcp_mtu_probing=1
net.ipv4.tcp_frto=2
net.ipv4.tcp_frto_response=2
net.ipv4.tcp_congestion_control = hybla
net.ipv4.tcp_allowed_congestion_control = hybla cubic

And then some general networking performance items:

net.core.rmem_default = 31457280
net.core.rmem_max = 12582912
net.core.wmem_default = 31457280
net.core.wmem_max = 12582912
net.core.somaxconn = 4096
net.core.netdev_max_backlog = 65536
net.core.optmem_max = 25165824
net.ipv4.tcp_mem = 65536 131072 262144
net.ipv4.udp_mem = 65536 131072 262144
net.ipv4.tcp_rmem = 8192 87380 16777216
net.ipv4.udp_rmem_min = 16384
net.ipv4.tcp_wmem = 8192 65536 16777216
net.ipv4.udp_wmem_min = 16384
net.ipv4.tcp_max_tw_buckets = 1440000
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1

And some for network security enhancement:

net.ipv4.tcp_synack_retries = 2
net.ipv4.ip_local_port_range = 2000 65535
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 15

And now a few to keep virtual memory usage under good control:

vm.swappiness=20
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2

And one to enhance RAM allocation for filesystem functions:

fs.file-max = 2097152

The above was compiled from these two excellent articles:

http://www.networkworld.com/article/2227856/opensource-subnet/best-networking-tweaks-for-linux.html
https://easyengine.io/tutorials/linux/sysctl-conf/

and other sources. Here is the whole set for wired (non-lossy) networking:

net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_workaround_signed_windows=1
net.ipv4.tcp_sack=1
net.ipv4.tcp_fack=1
net.ipv4.tcp_low_latency=1
net.ipv4.ip_no_pmtu_disc=0
net.ipv4.tcp_mtu_probing=1
net.ipv4.tcp_frto=2
net.ipv4.tcp_frto_response=2
net.ipv4.tcp_congestion_control=illinois
net.core.rmem_default = 31457280
net.core.rmem_max = 12582912
net.core.wmem_default = 31457280
net.core.wmem_max = 12582912
net.core.somaxconn = 4096
net.core.netdev_max_backlog = 65536
net.core.optmem_max = 25165824
net.ipv4.tcp_mem = 65536 131072 262144
net.ipv4.udp_mem = 65536 131072 262144
net.ipv4.tcp_rmem = 8192 87380 16777216
net.ipv4.udp_rmem_min = 16384
net.ipv4.tcp_wmem = 8192 65536 16777216
net.ipv4.udp_wmem_min = 16384
net.ipv4.tcp_max_tw_buckets = 1440000
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_synack_retries = 2
net.ipv4.ip_local_port_range = 2000 65535
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 15
vm.swappiness=20
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
fs.file-max = 2097152

and another full set for wireless / lossy networking:

net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_workaround_signed_windows=1
net.ipv4.tcp_sack=1
net.ipv4.tcp_fack=1
net.ipv4.tcp_low_latency=1
net.ipv4.ip_no_pmtu_disc=0
net.ipv4.tcp_mtu_probing=1
net.ipv4.tcp_frto=2
net.ipv4.tcp_frto_response=2
net.ipv4.tcp_congestion_control = hybla
net.ipv4.tcp_allowed_congestion_control = hybla cubic
net.core.rmem_default = 31457280
net.core.rmem_max = 12582912
net.core.wmem_default = 31457280
net.core.wmem_max = 12582912
net.core.somaxconn = 4096
net.core.netdev_max_backlog = 65536
net.core.optmem_max = 25165824
net.ipv4.tcp_mem = 65536 131072 262144
net.ipv4.udp_mem = 65536 131072 262144
net.ipv4.tcp_rmem = 8192 87380 16777216
net.ipv4.udp_rmem_min = 16384
net.ipv4.tcp_wmem = 8192 65536 16777216
net.ipv4.udp_wmem_min = 16384
net.ipv4.tcp_max_tw_buckets = 1440000
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_synack_retries = 2
net.ipv4.ip_local_port_range = 2000 65535
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 15
vm.swappiness=20
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
fs.file-max = 2097152

Categories:      

==============

File and folder synchronization, local, SSH, and mobile
article #919, updated 7 days ago

FreeFileSync is a great piece of work, it synchronizes files and folders between local drives, over SSH, and to mobile devices via MTP over USB.

Categories:      

==============

An Android Toolkit
article #918, updated 7 days ago

Android is very interesting to study. It’s more or less the foundation-stones of a generic Linux, including kernel with filesystems and the ability (though usually not the built-in functionality) to run many standard system binaries, but depending on code running in an interpreter — a virtual machine set up like Java, but not Java — instead of most of what we have in a GNU/Linux OS setup.

The potential of Android to be useful is extraordinary. It is very lightweight, it achieves an enormous amount of functionality for very little code: Windows needs about 20-40 gigabytes, Debian Linux perhaps 10-20, for what Android 4 does in about 0.5.

Of course there are downsides. The most important one is probably the fact that right out of the box, very high responsiveness is probably more the exception than the rule, one usually has to work at it to get Android to be very very responsive, i.e., to respond as fast as you think or close. But it is very possible, even on hardware multiple years old, and the payoff is huge, because the Android software universe is very large, far larger than any other non-desktop OS.

So without more ado, here we have an Android toolkit confirmed at this date to be able to do very well on two Fujitsu Stylistic M532’s, and one HTC EVO 4G LTE:

  1. Rooting.

Rooting is very very important. Without rooting one is limited to the whims of the manufacturer of your device, and the manufacturer very much wants you to throw yours out and buy a new one as soon as possible. On the other hand, if one starts with rooting, one can buy a multiple-year-old device at glyde.com or other sources at very nice prices, fix it up nicely, and have something useful to keep for years afterwards. Raimod’s Root Master and also Kingroot are two very worthwhile rooting tools for a very wide variety of devices. The instructions can be a little difficult, and HTC requires a different step provided by HTC to be done first (to “unlock the boot loader”), but it is all very well worth the trouble when the steps below come next. If yours won’t root with either of the above tools, contact the toolmakers and tell them, and/or do a bit of research and see if you can find a way it’s well-known to be done for yours.

  1. Get a microSD card.

A microSD card is a tiny long-term storage device, smaller than your pinky fingernail. We have several uses for this below, one of which is immediately next. You’ll want either a Class 10 microSD card, or an SDHC card; 16 gigabytes is probably good, smaller ones are getting rarer and unless you plan on keeping a whole lot of music or video within your device, larger will not help. SDHC cards are faster, but not all devices support them. Class 10 microSD cards are a whole lot faster than the older Class 4, and thus the Class 10’s are definitely to be used.

  1. Speed up your device a lot with root-level memory management.

Once a device is rooted, we can speed it up a whole lot. The easiest way to do this is to change how Android manages memory, and we have found one very nice applet for this, called Swapper for Root, by DevLab Technologies.. It needs to be run just once; the most important setting is the Swappiness, set that to 10.

Swapper also can do something for overall system stability: it will enable virtual memory, not something default on Android, and we can tell it to place the page file on the SD card we added in the previous step. On my devices, the external SD card is /sdcard2 (and the internal is /sdcard), this does vary from machine to machine. I gave it the default swap file size for now (200M), if I ever learn a reason to change this I will post it here.

  1. Improve speed and stability by replacing OEM system-installed apps, with user-installed apps.

This is where it gets tricky, but the results are very desireable. The idea is that in their wisdom [ahem] the device manufacturers have shipped them with versions of vital applications in the /system area, a small partition which ordinarily cannot be touched or altered. Unless one uses root methods, one can only “remove updates” to these, one can not update the versions actually in the tablet, and I have found that this can cause interesting problems with updates not working, overall slower behavior, and worse things. I imagine that for the first year or so this helps the devices stay working by preventing alterations, but by the time the third and fourth year roll around, well…yah. So here we go.

You will need a tool which makes it easy not only to study system-level apps, but to reliably remove them. System Application Manager by Flaki is a very good example. There are quite a large number of apps out there which do the study, but which do unpleasant things with removals, especially due to something called “odexing”; on many Android devices system apps are “odexed”, and the practical implications are that removals fail unless the apps handle it properly. As of Android 5 there is something else replacing “odexing” which does effectively the same thing; S.A.M. by Flaki may not be able to handle that, so if you have Android 5 or up please let me know what you find!

You will also need a tool which makes it easy to see how you are doing with free space in your /system partition. This is actually quite a lot harder than I expected, but System Cleaner 2, also by Flaki, does it very well. System Cleaner 2 also can do something which I do not prefer; it permits actual updates of the /system partition app sets. I don’t prefer this for two reasons: (a) /system is usually almost full and has to be to hold the Android OS elements, and (b) I tried it, it said it successfully updated the Play Store and Play Store Services with the rest of the items, but the Play Store did not work from that point on, I had to use S.A.M. to remove Play Store and P.S.S. and install using APKs downloaded directly from Chrome. So I use SC2, but for diagnostics, to see what old apps remain in /system, and how much space there is in there.

The beautiful thing is, once one uses S.A.M. to remove system apps altogether, one can replace them, and the replacements are not system apps (taking up that precious space in /system), but are user apps. So my situation with the Play Store and P.S.S. eventually became beneficial, I gained increased reliability and speed in general. For other apps — Chrome, content-specific Play items, and third-party things installed as system apps by the manufacturer — I just remove them using S.A.M. and install them anew from the Play Store and all is wonderful.

  1. Move apps to your microSD card.

This will save space on the internals of your device, and also, if you have a nice fast microSD card as recommended, will gain you overall speed too. Just go into Apps under Settings, touch the name of each app, and if it can be moved, the option will be lit. Highly recommendable. There are non-system apps which can not be moved, and so this is a step to keep your device working well, especially if it is one of the more bargain ones with very small internal storage. This does not require root, but it is by far the least of the list!

Categories:      

==============

Disable WSUS in SBS 2011
article #910, updated 10 days ago

Completion of these steps will free up a lot of resources on an SBS. You will need to have a different method (e.g., Labtech) to keep client machines up to date.

  1. Run (install first if not present) the SQL Server Management Studio.
  2. Connect the Studio, to type Database Engine, server name “\\.\pipe\mssql$microsoft##ssee\sql\query”
  3. In the Studio, under Databases, you will find an item “SUSDB”.
  4. If you don’t know where the database files are held, find them using the properties of that item.
  5. Right-click SUSDB, open Tasks, “detach” SUSDB, and close the Studio.
  6. Delete the database files and all of the update files.
  7. Disable the WSUS-related items in services.msc and IIS.

The above is digested from the following:

https://social.technet.microsoft.com/Forums/en-US/d7f5d5bb-6623-4d46-80e6-421674a46829/remove-wsus-from-sbs2011-server?forum=smallbusinessserver

http://blog.mpecsinc.ca/2011/07/sbs-2011-wsus-sql-memory-usage-is-very.html

Categories:      

==============

Windows Server Essentials integration with Office 365
article #916, updated 10 days ago

If it’s not working or not working well for you, try this:

  1. In the Dashboard, Disable Office 365 integration and Azure integration. It’s two separate steps. If you disable just Office 365 integration you won’t be able to continue.
  2. Set up Office 365 integration.
  3. See lots of interesting information come up quite quicly, in the Office 365 tab after you restart the Dashboard, to confirm that your integration is working very nicely.
  4. If it didn’t work well, open your firewall per Microsoft, and test again.

Categories:      

==============

Custom power plans in Group Policy
article #917, updated 10 days ago

It can be very helpful to distribute a power plan in Group Policy, especially if there are laptops needing wifi SQL connections which must not ever cut off. The best way I have found, is to use this location in GP:

User Configuration / Control Panel Settings / Power Options

and create a new one there, with a new name, set as default. It may be helpful to do the same under Computer Configuration just in case there are hidden overrides out there.

There is another set of settings using the power plan GUID, but I have not found any way to automatically distribute power plans via group policy and keep the GUID consistent in all machines, even import/export does not do this.

Categories:      

==============

Clean up all system and user profile temp folders, and other temp folders
article #484, updated 14 days ago

For quite a while I have been curious as to why a simple method to do this has not been available. CCLEANER and others do not reach into all profiles, and there are other lacks. Well, the following .VBS originated with the excellent David Barrett (http://www.cedit.biz) and has now been tweaked by yours truly up through Windows 10/2016. One thing discovered along the way, is even in XP there is a user profile called the “System Profile” — XP has it in C:\WINDOWS\System32\config\systemprofile — and malware often dumps junk into it, and sometimes many gigs of unwanted files can be found in its temporary storage. The below cleans all user profiles including those, as well as the Windows Error Reporting cache, and the .NET caches, and the system TEMP folders.

If you’re running it on Vista/2008 or above, do use an administrative CMD or equivalent.

The full text can be downloaded here in a zip file.

Categories:      

==============

Choose Your Own Netflix Categories
article #915, updated 15 days ago

Netflix has a lot of categories, and its designers have given its much too much capability to make our decisions for us. Here is a better way. First, browse to this page, and find category numbers which match your interests:

http://whatsonnetflix.com/netflix-hacks/the-netflix-id-bible-every-category-on-netflix/

Then, plug those numbers into this URL template (the current one is near the top of the page, pasted at this writing below):

http://www.netflix.com/browse/genre/INSERTNUMBER

So for instance, let’s say that you like general science fiction, and you are sick and tired of the small selection Netflix has been feeding you. Searching down the list, one finds that “sci-fi” is the shorthand, and we also see that there are many small categories with this included, as well as one big one, “Sci-Fi and Fantasy”, number 1492. So then we browse here:

http://www.netflix.com/browse/genre/1492

and log in if you’re not already, and voila!

Categories:      

==============

Optimize an SQLite database file
article #914, updated 15 days ago

Just make sure that no processes are using the file, make a backup of it for safekeeping, and then:

sqlite3 *.db "VACUUM;"

Compare sizes and you’ll see how much you have done!

Very useful to optimize database tables in MyBB with SQLite, among many other purposes :-)

Categories:      

==============

Very simple machines this time: suspenders
article #912, updated 15 days ago

This post is not for all or even most, certainly :-) But if you want suspenders which snap onto belt loops, rather than the usual variations on alligator clips or buttons, they really exist and work very well, from here:

http://www.suspendease.com/snap-on-clip-suspenders.html

Here’s a pic:

Categories: