Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
25% Recurring Discount on NVMe VPS
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Re-enabling AES-NI on VPSes that don't pass the feature through

2»

Comments

  • Nope, still returns OPENSSL_ia32cap=0x80202001478bfffd:0x0000000000000000:0x0000000000000000:0x0000000000000000:0x0000000000000000

  • forestforest Member
    edited 11:03AM

    @JohnFilch123 said:
    Nope, still returns OPENSSL_ia32cap=0x80202001478bfffd:0x0000000000000000:0x0000000000000000:0x0000000000000000:0x0000000000000000

    Okay that means it's working fine, you just have an old CPU so only LV0 is set. Notice how now it's 0x80202001478bfffd but before it was 0x82202001478bfffd. That means, after that reboot, it's successfully enabled AES-NI.

    Restart the shell or source /etc/environment to get the modified value back and try openssl speed -evp aes-256-ctr again and you should see substantial improvements compared to before the reboot.

  • @forest said: substantial

    Doing AES-256-CTR ops for 3s on 16 size blocks: 9029090 AES-256-CTR ops in 2.32s
    Doing AES-256-CTR ops for 3s on 64 size blocks: 2195362 AES-256-CTR ops in 2.26s
    Doing AES-256-CTR ops for 3s on 256 size blocks: 547776 AES-256-CTR ops in 2.22s
    Doing AES-256-CTR ops for 3s on 1024 size blocks: 143612 AES-256-CTR ops in 2.41s
    Doing AES-256-CTR ops for 3s on 8192 size blocks: 18325 AES-256-CTR ops in 2.17s
    Doing AES-256-CTR ops for 3s on 16384 size blocks: 9236 AES-256-CTR ops in 2.22s
    version: 3.5.6
    built on: Sat Jun  6 19:55:35 2026 UTC
    options: bn(64,64)
    compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -fzero-call-used-regs=used-gpr -Wa,--noexecstack -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/openssl-3.5.6=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DZLIB -DZSTD -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
    CPUINFO: OPENSSL_ia32cap=0x80202001478bfffd:0x0000000000000000:0x0000000000000000:0x0000000000000000:0x0000000000000000
    The 'numbers' are in 1000s of bytes per second processed.
    type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
    AES-256-CTR      62269.59k    62169.54k    63166.96k    61020.20k    69178.99k    68163.34k
    

    It was more or less the same, cannot really say there is a substantial improvement but if it worked. I wonder if upgrading the kernel will help (I am on 6.12 currently) and doing setcpuid=153.

  • MurvMurv Member, Megathread Squad

    @JohnFilch123 said: CPUINFO: OPENSSL_ia32cap=0x80202001478bfffd:0x0000000000000000:0x0000000000000000:0x0000000000000000:0x0000000000000000

    I think in your case openssl is not seeing the OPENSSL_ia32cap environment variable at all.

    It'll let you know whenever it's overriding the cpuid flags, a snippet from my own tests:

    CPUINFO: OPENSSL_ia32cap=0x82382203478bfffd:0x0000000000000000:0x0000000000000000:0x0000000000000000:0x0000000000000000 env:0x82382203478bfffd
    

    (See the env:0x82382203478bfffd at the end.)

    Also in my Gcore VM it's significantly faster:

    type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
    AES-256-CTR     317686.02k   855453.25k  2190144.00k  3186075.65k  4041329.32k  3692068.86k
    
    Thanked by 1JohnFilch123
  • forestforest Member
    edited 11:17AM

    @Murv said: I think in your case openssl is not seeing the OPENSSL_ia32cap environment variable at all.

    No, it is. It showed a different output after he unset the variable.

    The output with the variable intact:

    OPENSSL_ia32cap=0x82202001478bfffd:0x0000000000000000:0x0000000000000000:0x0000000000000000:0x0000000000000000
    

    The output after he unset it (note the 0x822... became 0x802...):

    OPENSSL_ia32cap=0x80202001478bfffd:0x0000000000000000:0x0000000000000000:0x0000000000000000:0x0000000000000000
    

    So it definitely sees it, but if nothing is actually happening performance-wise, there must be another reason.

    Thanked by 1Murv
  • Ya something is not working on my VM.

  • MurvMurv Member, Megathread Squad

    @forest said: No, it is. It showed a different output after he unset the variable.

    Ahhh, me weeb-brain misread that.

    Ya something is not working on my VM.

    Can you try OPENSSL_ia32cap=0x82382203478bfffd openssl speed -elapsed -evp aes-256-ctr

  • @Murv said: OPENSSL_ia32cap=0x82382203478bfffd openssl speed -elapsed -evp aes-256-ctr

    You have chosen to measure elapsed time instead of user CPU time.
    Doing AES-256-CTR ops for 3s on 16 size blocks: 56341443 AES-256-CTR ops in 3.00s
    Doing AES-256-CTR ops for 3s on 64 size blocks: 40769437 AES-256-CTR ops in 3.00s
    Doing AES-256-CTR ops for 3s on 256 size blocks: 22920127 AES-256-CTR ops in 3.00s
    Doing AES-256-CTR ops for 3s on 1024 size blocks: 10144178 AES-256-CTR ops in 3.00s
    Doing AES-256-CTR ops for 3s on 8192 size blocks: 1228916 AES-256-CTR ops in 3.00s
    Doing AES-256-CTR ops for 3s on 16384 size blocks: 593197 AES-256-CTR ops in 3.00s
    version: 3.5.6
    built on: Sat Jun  6 19:55:35 2026 UTC
    options: bn(64,64)
    compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -fzero-call-used-regs=used-gpr -Wa,--noexecstack -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/openssl-3.5.6=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DZLIB -DZSTD -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
    CPUINFO: OPENSSL_ia32cap=0x82382203478bfffd:0x0000000000000000:0x0000000000000000:0x0000000000000000:0x0000000000000000 env:0x82382203478bfffd
    The 'numbers' are in 1000s of bytes per second processed.
    type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
    AES-256-CTR     300487.70k   869747.99k  1955850.84k  3462546.09k  3355759.96k  3239646.55k
    
  • MurvMurv Member, Megathread Squad

    @JohnFilch123 said:
    type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
    AES-256-CTR 300487.70k 869747.99k 1955850.84k 3462546.09k 3355759.96k 3239646.55k

    Looks like my value works for you?
    68163.34k vs 3239646.55k

  • @Murv said: Looks like my value works for you?

    Ah, seems like it did the trick, even though I still get zeros everywhere in the output of openssl info -cpusettings

  • forestforest Member
    edited 11:38AM

    @JohnFilch123 said: even though I still get zeros everywhere in the output of openssl info -cpusettings

    That's normal for your CPU, given that you got that even after you did that unset command.

    I thought it was weird at first, but apparently the CPU is just old.

    Thanked by 1JohnFilch123
  • @forest said: CPU is just old

    Yep, welcome to Armenia but well...it is what it is, hopefully it will give my tor relay a boost.

    Thanked by 1forest
  • forestforest Member
    edited 11:47AM

    @JohnFilch123 said: Yep, welcome to Armenia but well...it is what it is, hopefully it will give my tor relay a boost.

    If you don't have much RAM, another thing that'll give it a nice boost is this:

    apt install jemalloc2 && systemctl edit --stdin [email protected] << EOF
    [Service]
    Environment="LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2"
    EOF
    

    That'll reduce RAM usage by ~70%, which can improve performance significantly on low-memory systems. It replaces the default Glibc memory allocator, ptmalloc3, with one called jemalloc2 which is much better at resisting memory fragmentation.

  • @rm_ said:

    @Nekopara said: tempted to run this on a GCORE vps which shows QEMU virtual cpu with nothing enabled

    It's a bit pointless, unless you know why you need it. Modern SSH, HTTPS and VPN (Wireguard) have moved on from AES to ChaCha20, and that doesn't rely on any hardware acceleration.

    Simply incorrect not sure where you people are educated.

    Yes ChaCha20 has seen wide mass adoption especially in VPN space, but AES and other original forms of encryption have had plenty of there own developments are are still heavy more implemented overall.

    AES-GCM, AES-GCM-SIV are actively modern competitors that still take use of hardware acceleration.

    Let’s not forget AES-XTS for other applications outside of general web traffic, data encryption king.

  • @forest said: If you don't have much RAM, another thing that'll give it a nice boost is this:

    1Gb, fix applied, many thanks.

    Thanked by 1forest
  • MurvMurv Member, Megathread Squad

    Also if anyone else is gooning in AES-GCM like me, enabling PCLMULQDQ alongside AES-NI will speed up AES-GCM even further.

    Just had to use 's/(0x[0-9a-f]{16})/sprintf("0x%016x", hex($1) | (1 << 57) | (1 << 33))/e' as the perl argument.

  • WilliamWilliam Member

    Are there even any CPUs wit VT that do not have AES? Atom maybe?

  • MurvMurv Member, Megathread Squad

    @William said:
    Are there even any CPUs wit VT that do not have AES? Atom maybe?

    This is for when the host CPU does support AES-NI but the flag is not set on the VM's CPU.
    For instance Gcore's basic VMs don't have AES-NI flag set but the host CPU does in fact support it.

    Thanked by 1mandala
Sign In or Register to comment.