What have you modified to improve performance?

So everyone knows, that on Linux and any other open source OS, everything you think you want to change you can change. Anything from removing some code in a Graphics Driver or writing your own personal CPU scheduler.

However it seems that a lot of the Linux "Know it All's" ( that is meant as a compliment and not as an insult) do not really post every tune-able or personal code out there to increase performance. I read another Linux Forum, about how users have their own partition setup to increase performance off of their hard disks, however they did not release their partition scheme.

It seems that the only thing that is mostly released in terms of modification in the Linux World is themes, and not performance improving ideas or scripts or anything along those lines.

So if you look at it at that way, we are more like Mac and Windows users, where all that we modify is a theme, and nothing internally.

So how about we change that?

Post what, you modified to your Linux install to increase performance. This is a broad term so anything from compile flags, to how you increased boot times, to ways you got faster FPS, to custom toolchaines to custom patches to custom sysctl.conf's and the like. Anything that you did ( i.e. changed or "modified" ) too make things faster from stock. Faster latencies, higher throughput, etc.. etc..

Here is what I did to increase performance on my lappy via sysctl.conf:

Network

sysctl -w net.core.rmem_max = 12388608
sysctl -w net.core.wmem_max = 97777216
sysctl -w net.core.rmem_default = 85536
sysctl -w net.core.wmem_default = 65536
sysctl -w net.ipv4.tcp_rmem = '4096 87380 12388608'
sysctl -w net.ipv4.tcp_wmem = '4096 65536 12388608'
sysctl -w net.ipv4.tcp_mem = '8388608 8388608 8388608'
sysctl -w net.ipv4.route.flush = 1
sysctl -w net.ipv4.tcp_window_scaling = 1
sysctl -w net.ipv4.tcp_slow_start_after_idle = 0
sysctl -w net.core.optmem_max = 25165824
sysctl -w net.core.netdev_max_backlog = 3100
sysctl -w net.ipv4.icmp_echo_ignore_broadcasts = 1
sysctl -w net.ipv4.tcp_keepalive_time = 260
sysctl -w net.ipv4.tcp_keepalive_probes = 5
sysctl -w net.ipv4.tcp_keepalive_intvl = 15
sysctl -w net.ipv4.neigh.default.gc_thresh1 = 256
sysctl -w net.ipv4.neigh.default.gc_thresh2 = 1024
sysctl -w net.ipv4.neigh.default.gc_thresh3 = 2048
sysctl -w net.ipv4.neigh.default.gc_interval = 60
sysctl -w net.ipv4.neigh.default.gc_stale_time = 120
sysctl -w net.ipv4.tcp_low_latency = 1
sysctl -w net.ipv4.tcp_timestamps = 0

System security

sysctl -w kernel.shmmni= 4096
sysctl -w kernel.shmmax= 17179869184
sysctl -w kernel.shmall= 8388608
sysctl -w kernel.sem= 250 256000 32 4096
sysctl -w kernel.msgmni= 16384
sysctl -w kernel.msgmax= 65536
sysctl -w kernel.msgmnb= 65536

Increase number of open files

sysctl -w fs.file-max= 18980

General

sysctl -w kernel.sched_child_runs_first = 0
sysctl -w vm.nr_hugepages = 0
sysctl -w vm.nr_hugepages_mempolicy = 0
sysctl -w vm.hugepages_treat_as_movable = 0
sysctl -w vm.nr_overcommit_hugepages = 0

Kernel modules add to boot time, things that you know that will be constant like, file systems, wifi cards, webcam sd card reader and cpu arch should be set as a built in, this can increase boot time by as much as 3 seconds.

But as far as kernel patches. The two that work the greatest together are the BFS patch and the low latency patch. Applications open faster, text documents open faster. Video playback while having other applications open in the background is smooth without frame drops. But of course throughput suffers, but for Desktop use it is unnoticeable for the most part. Only when trying to open multiple 8meg+ images can you tell of the bad throughput.

And this is not a hate thread, if I come off like a jerk I am sorry. And please excuse how this is written, English is my first language but I speak slangish more then English.

*sidenote
The person who came up with the 20,000 letter captcha is not my friend at the moment.

2 Likes

I don't think that's a formula that will work for everyone though. Over here, we're mostly on IPv6, and that kinda changes the game in terms of network performance, on the one hand more complex, on the other hand much more simple, but again, it's highly dependent on the specific application what tweaks work for what machine.

There are a lot of tweaks seasoned linux users do, that other seasoned linux users don't. The basis of all performance, if that's really what you're after, is the clean custom compiled kernel with specific tweaks and modules. For instance, the huge problems with the last two generations of Intel CPU's with SpeedStep. Well at least linux users don't get the crashes/BSOD's that Windows and Mac users get, but the performance is still enormously inhibited in certain circumstances and with certain loads. There are a number of Linux users that use bleeding edge kernels, and have seen these problems resolved or almost resolved automatically with the regular distro updates. Others prefer releases with a bit more mileage or use specific hardened kernels that are a bit older, and they have to take care of these problems themselves by manually loading the microcode updates Intel posts. It's just one of many examples. Linux is still pretty technical for those that want to get the most out of everything, but it will also offer a stable maintenance-free platform for those who don't. Windows users that want more performance are constantly tweaking, to a point where many tweaks that people (even professionals) use, don't make any sense whatsoever, but are more superstition than anything else (that's the downside of not being able to access the code, it's a mystical experience, woooh...lol). Tweakers tweak, hassle-free users don't. Both are legit use case scenarios.

1 Like

True, what works for one person does not work for everyone, but it would still be nice to see mods and have the public decide on their own what works and what does not.

Of course by far, stripping the kernel of everything unnecessary by far increases performance the most, but other things factor in to performance as well. A stripped kernel may improve the loading time of apps and boot times but it does not increase the transfer rate of HDD and network performance.

Just like adding an SSD would increase transfer rates boot times and app loading times, but it will not increase network speed, FPS (although it is true, with SSD's you will get maybe two or three fps increase) to the point where doing other mods is unnecessary.

*off topic
But I remember back in my Windoze days, where there were a whole bunch of regedit tweaks, some worked for some and most did not. What was nice to see was the people that came up with the tweaks published their findings for the people to decide and not say : "I found out how to increase Network performance, but it only works for me. So I wont post it." Hardware makers do not just make one motherboard model and that is it. They make thousands of one model, so there are 999 other people you could be helping out there.

I have not done anything. Because my pc is already faster then any noticeable change will make, no part of it makes me go, "i wish this happened 10 milliseconds faster"

2 Likes

What I did is actually just a bit fine-tuning of my fstab to run better on SSDs but that is all already quite good documented on the interwebs.

Also many things I fumbled with are for making the linux work good with my Thinkpad e.g. TLP configuration and such which is also great documented.

One thing I would realy like to get optimized is the use of the iGPU of the i7 for more of the codecs avaliable as usually thy arn't GPU accelerated under linux which is a terrible pain with an ULV processor as it will have to work a lot and thus gets hot and the macine get's loud.

I wish I could be like you, I wish everything was faster. I literally time how long it takes to eat an apple, and come up with different eating techniques to increase consumption time.

But what also is cool, is that instead of shelling out say, $700 for a 16gb pc with a extreme i7, you can tune your already owned old hardware to get better performance so you do not have to shell out the money to upgrade the performance of your PC. Because all you are doing is modifying code, its free.

Its like exercise, buying expensive running shoes may help you run faster, but it is not going to make you run faster, exercising, which is free ( if you do not go to the gym or by equipment ) will make you run faster.

Your machine is fast because of the hardware, but the software written may not be optimized, so it will take the CPU more time to get the task done, so you will be using more electricity.

If you were to use some tweaks, you could disable your two of your four cores ( I am guessing you have a quad core, most people do nowadays ) so that with only two cores, the computer is as fast as when you were running four cores with out the optimizations. So since you are only using two cores, you would be using less electricity, resulting in a lower electric bill.

Did you switch to deadline scheduler? Deadline is recommended for SSD life and performance.

Yes I did so.

Well my system's resell for just about as much as i paid for them for example my 4790k 8GB ram 500gb ssd 1tb wd and 980 only cost me 500$ because my old system sold for $1k.

I don't care about my electric bill, electricity is very cheap where I am so it doesn't even matter my pc is super efficient as it is. But to each his own. I get why someone would want to tweak things, It's just not something I do.

You got all of that for really cheap. Did you get that via Newegg during a holiday or black Friday?

black friday. Why would you not buy a new system on a holiday sale if you are looking at upgrading?

I agree, there is no amount of tweaking that can fix slow PC, as long as you have dual core and SSD, there should be no noticable difference in overall system performance.

In other words, system performance, apart from maybe 4k+ streaming and games, should be identical on last few generations (and even older, sucha s c2d) dual core PC with 4GB of RAM and SSD, and octacore I7 with xGB of RAM and SSD.

I'm one of those people like @Urworstnit3m3r that thinks my computer is already fast enough and that there isn't much I would change.

There is one particular aspect I would like to learn how to speed up though. It might not be fixable, but when I'm connected to my home server via Samba, I am able to copy files at around 100mb/s on Windows, but limited to about 40mb/s on Linux.

Otherwise, the only thing I would like to change is overall system stability. How can I get the OS so it doesn't seem flaky and will handle everything I throw at it without simple problems that other operating systems don't have. I mean things like resuming from sleep, booting up without seeing any text or constant screen flickers (Windows and Mac OS X boot up without any verbose information, strictly splash screens). The kind of stuff that makes you think that an operating system is polished and isn't just a mash up of different software projects with a fancy name released every 6 months.

Sorry for the slight tangent. :)

Did you time with your own timing device, or did you trust what Windows shows on the screen? Because if you would time yourself manually, you would see that you can actually transfer files faster at the socalled 40 MB/s in linux than you can at socalled 100 MB/s in Windows lolz. But that's just one of those things you know...

Also, check the protocols, sometimes you can use other protocols that are more efficient. Sometimes ftp is faster, sometimes afp is faster, sometimes smb is faster, it all depends on several things.

You can turn off the verbose feedback at boot in linux. In fact, that 's the default state. The fact that it is verbose (which is appreciated by most users), means that verbose is requested. It's easy enough to fix. In grub, press "e" on the line that matches the boot entry that you normally use, look for "verbose", delete the word "verbose", and press F10. If you like that better, make it persistent by redracuting the initramfs, and you're set.

There are articles out there like this one, that allows Linux to boot without the text crud that shows on the screen.

http://www.refining-linux.org/archives/4/Boot-your-Linux-silently/

I remember way back in Ubuntu 10.04 and 10.10 that every couple of minutes my screen would get these white flickers, luckily they fixed the open source driver for that. If by flicker you meant that and not something else.

I guess I am the only one here that thinks that adding in more performance then buying newer hardware is a great idea. I must be crazy. Lulz

I am glad I posted this rather then what I was originally going to post which was a rant on how, now with Chrome OS and Steam OS, that Linux should be forked so that there would be the standard, stable kernel that supports all old hardware and new hardware and a kernel that only supports newer hardware and was performance driven.

Like how Android is basically a Linux fork focused on mobile devices. The new fork would be focused on the Desktop for the Desktop.

One thing that I am sure that lots of Linux users would like, maybe not the hardcore overclocker's that use the BIOS for overclocking, but overclocking in the Linux kernel would be great for both CPU and GPU, as well as for the Bus' on the locked down "box" PC's and even the unlocked Mobo's.

Since gamer's are coming to Linux maybe this feature will becoming sooner then later.

Not at all, there are often more ways to accomplish a goal ^^ one fine-tune

Hopefully much better implemented than under windows ^^ some of the OC tools are realy realy crude and scary ^^

, others throw money at it. Both ways are very legit and get the results wanted =)

I haven't changed the verbose mode on any system I have used. Everything is default. I do see why it is useful, however sometimes I do see "leaks" where it does show a few lines odd lines.

I just recently installed Xubuntu on an old Acer laptop as an example. After it posts, I get a black screen with the backlight on which stays like that for a few seconds. Then the backlight turns off for about a second. It then turns back on for another second before showing the typical Xubuntu loading screen. Once that runs for a few second the screen goes black again (backlight on) before showing the login screen. Once the password is entered, the screen goes black again before finally showing the desktop. (hopefully that made sense)

On shutdown I get a few lines of text before the computer shuts off.

My point is that I have yet to see a Linux distribution that has had as smooth of transitions in the booting and shut down sequences as Windows and Mac OS X. It is obviously not a big deal, but shows how polished the system is. The constant backlight on and off could mean the display will possibly go to sleep on a desktop screen, which can be rather annoying to wait for it to wake up again.

As for the file transfers on SMB, you may be right about it not being accurate. I will need to do some research into it. Maybe FTP is faster. I suppose network traffic might be a good indicator of transfer speed? I wasn't sure if there was some overhead on Linux that wasn't present on Windows because SMB is native to Windows and not Linux.

The thing with the screen turning off and on is very logical. There are a few things that happen when you boot up and log in. First your screen is governed through direct VESA access, just like in Windows or any other OS. In Linux, that is your boot manager, just like the Windows boot manager (the course spinning dots in Windows X). The difference is, that linux gives you choice at that time. That choice is determined by the content of initramfs and grub files. Grub will let you set-and-forget what choices have to be offered to you at bootup, and initramfs lets you set what each selection in the grub menu has to do. In general the default linux entry in grub, based on the most recent kernel, will first start a display manager like KDM or GDM. Those are the main display managers for users that use a DE. Ubuntu Gnome and Ubuntu Unity both use GDM. GDM loads the log-in screen, which lets you log in, and offers you a new choice, in Gnome whether to load Gnome on X11 or Gnome on Wayland. Usually you would go for Gnome on X11 because it's a bit more stable than Gnome on Wayland. The thing is though, on recent distros, GDM itself already runs on Wayland. So basically, the system starts in VESA, then loads X (that happens when the command "startx" is executed, you see that happen in the verbose feedback, you can also start X manually from CLI, for instance in another TTY). Now with those recent distros, it will go from VESA (no display server), to loading the Wayland display server to show GDM or KDM for the login screen, and then you'll probably select the DE running on X11, so that the system will unload Wayland, and will load X11 again. Every transition binds in with quite a few mechanisms, like backlighting, ACPI, power management, a lot of configs that have to be loaded, etc... and linux does that pretty fast, but it's still a process. Windows is not a GUI shell like linux, the OS is graphical in itself, so everything loads and at the end you log in, and then some background stuff still loads. On linux, you have to choose, and the system, which is not graphical by nature, will wait for your selection, and load just what you asked, nothing more, nothing less. In practice, on modern distros, that means that the screen will revert to the modeswitching logic two times, once when Wayland loads for the GDM log-in manager, and then again when Wayland is killed and X11 loads for Gnome. On Ubuntu Unity, you only have one such movement if you're using KMS drivers, because both the log-in manager (GDM) and the DE (Unity) still run on X11, as Mir is still in development and is reserved for Unity 8. If you use proprietary graphics drivers old style (not AMDGPU-based), then you see a different splash screen, because proprietary graphics drivers are not KMS drivers, the graphics mode (the resolution, refresh frequency, etc) cannot be set by the kernel, but the stack is loaded without setting a mode (that's why "nomodeset" is added in initramfs so that the system knows not to let the kernel set a mode at boot). That's why you get a different splash screen, because the more graphical splash screen that can be displayed with KMS drivers (because the mode is set, a graphical splash screen can be rendered already), can't be shown, and instead you get a simplified splash screen with a simplified animation, like a simple ASCII loading bar in most distros or badly rendered dots in Ubuntu, instead of the graphical splash animations you get when using open source drivers.

2 Likes

Interesting. So on a basic level the constant changes in the screen during a boot is the starting and stopping of certain display processes like X11 and Wayland as each of the components of the OS begin to start, serve their purpose, and shut down. Adding proprietary graphics drivers then adds more complexity into the system. All of this is because a Linux system is a command line based OS with a GUI built on top rather than a GUI OS that also has a command line.

I suppose it does a full circle to the point that one shouldn't expect Linux to run like Windows and Mac OS X.