performance – Why is the execution time on Datagrip longer on MySQL 8 than MySQL 5.7 on a new Linux Server?

I am migrating from a 4 year old setup to a brand new high performance server and am experiencing slower performance than on the old machine.

The old setup is a Ubuntu 16.04 Server on bare metal Intel i7 64G RAM and MySQL 5.7 and is under medium load with many services running.

The new setup is an AMD Ryzen™ 9 5950X with 128G RAM, no load and only MySQL 8 running on Ubuntu 20.04. Both are bare metal machines and I am the only one who can access it.

Now the database I am testing against holds a table with 100M rows. The new one holds an exact copy, imported after a mysqldump. I am running the exact same simple query without any join, just from one table.

The old server returns the result in about 120ms the new one returns in about 200ms.

10 rows retrieved starting from 1 in 192 ms (execution: 184 ms,
fetching: 8 ms)

I am using DataGrip for the query (connected via SSH). If I connect via SSH terminal directly and use MySQL on the console the result is returned in 0.00s

How is that even possible? I did run a few tests via mysqltuner, but found nothing that might be of help.

Here is part of the the my.cnf from the new server:

(mysqld)
default_authentication_plugin= mysql_native_password
innodb_buffer_pool_size = 100G
innodb_buffer_pool_instances = 64
innodb_buffer_pool_chunk_size = 134217728
innodb_log_file_size = 12G    
collation_server        = utf8_unicode_ci
character_set_server    = utf8

This is mysqltuner output:

mysqltuner
 >>  MySQLTuner 1.7.13 - Major Hayden <major@mhtx.net>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering

(--) Skipped version check for MySQLTuner script
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password: (!!) Currently running unsupported MySQL version 8.0.25-0ubuntu0.20.04.1
(OK) Operating on 64-bit architecture
 
-------- Log file Recommendations ------------------------------------------------------------------
(--) Log file: /mnt/mysql/data/leo.err(0B)
(!!) Log file /mnt/mysql/data/leo.err doesn't exist
(!!) Log file /mnt/mysql/data/leo.err isn't readable.
 
-------- Storage Engine Statistics -----------------------------------------------------------------
(--) Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA 
(--) Data in InnoDB tables: 16.8G (Tables: 39)
(OK) Total fragmented tables: 0
 
-------- Analysis Performance Metrics --------------------------------------------------------------
(--) innodb_stats_on_metadata: OFF
(OK) No stat updates during querying INFORMATION_SCHEMA.
 
-------- Security Recommendations ------------------------------------------------------------------
(--) Skipped due to unsupported feature for MySQL 8
 
-------- CVE Security Recommendations --------------------------------------------------------------
(OK) NO SECURITY CVE FOUND FOR YOUR VERSION
 
-------- Performance Metrics -----------------------------------------------------------------------
(--) Up for: 1m 47s (419 q (3.916 qps), 45 conn, TX: 402K, RX: 35K)
(--) Reads / Writes: 100% / 0%
(--) Binary logging is enabled (GTID MODE: OFF)
(--) Physical Memory     : 125.8G
(--) Max MySQL memory    : 104.2G
(--) Other process memory: 136.7M
(--) Total buffers: 104.0G global + 1.1M per thread (151 max threads)
(--) P_S Max memory usage: 72B
(--) Galera GCache Max memory usage: 0B
(OK) Maximum reached memory usage: 104.0G (82.72% of installed RAM)
(OK) Maximum possible memory usage: 104.2G (82.85% of installed RAM)
(OK) Overall possible memory usage with other process is compatible with memory available
(OK) Slow queries: 0% (0/419)
(OK) Highest usage of available connections: 1% (2/151)
(!!) Aborted connections: 4.44%  (2/45)
(!!) name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
(--) Query cache have been removed in MySQL 8
(OK) Sorts requiring temporary tables: 0% (0 temp sorts / 19 sorts)
(!!) Joins performed without indexes: 18
(OK) Temporary tables created on disk: 0% (0 on disk / 23 total)
(OK) Thread cache hit rate: 95% (2 created / 45 connections)
(OK) Table cache hit rate: 80% (327 open / 408 opened)
(OK) Open file limit used: 0% (2/10K)
(OK) Table locks acquired immediately: 100% (9 immediate / 9 locks)
(OK) Binlog cache memory access: 0% (0 Memory / 0 Total)
 
-------- Performance schema ------------------------------------------------------------------------
(--) Memory used by P_S: 72B
(--) Sys schema is installed.
 
-------- ThreadPool Metrics ------------------------------------------------------------------------
(--) ThreadPool stat is disabled.
 
-------- MyISAM Metrics ----------------------------------------------------------------------------
(!!) Key buffer used: 18.2% (3M used / 16M cache)
(!!) Cannot calculate MyISAM index size - re-run script as root user
 
-------- InnoDB Metrics ----------------------------------------------------------------------------
(--) InnoDB is enabled.
(--) InnoDB Thread Concurrency: 0
(OK) InnoDB File per table is activated
(OK) InnoDB buffer pool / data size: 104.0G/16.8G
(OK) Ratio InnoDB log file size / InnoDB Buffer pool size: 12.0G * 2/104.0G should be equal 25%
(OK) InnoDB buffer pool instances: 64
(--) Number of InnoDB Buffer Pool Chunk : 832 for 64 Buffer Pool Instance(s)
(OK) Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
(!!) InnoDB Read buffer efficiency: 13.96% (5858 hits/ 41974 total)
(OK) InnoDB Write log efficiency: 98.44% (630 hits/ 640 total)
(OK) InnoDB log waits: 0.00% (0 waits / 10 writes)
 
-------- AriaDB Metrics ----------------------------------------------------------------------------
(--) AriaDB is disabled.
 
-------- TokuDB Metrics ----------------------------------------------------------------------------
(--) TokuDB is disabled.
 
-------- XtraDB Metrics ----------------------------------------------------------------------------
(--) XtraDB is disabled.
 
-------- Galera Metrics ----------------------------------------------------------------------------
(--) Galera is disabled.
 
-------- Replication Metrics -----------------------------------------------------------------------
(--) Galera Synchronous replication: NO
(--) No replication slave(s) for this server.
(--) Binlog format: ROW
(--) XA support enabled: ON
(--) Semi synchronous replication Master: Not Activated
(--) Semi synchronous replication Slave: Not Activated
(--) This is a standalone server
 
-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
    MySQL was started within the last 24 hours - recommendations may be inaccurate
    Reduce or eliminate unclosed connections and network issues
    Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
    Adjust your join queries to always utilize indexes
Variables to adjust:
    join_buffer_size (> 256.0K, or always use indexes with JOINs)

What is a recommended aproach to narrow down the problem?

operating systems – In Round-Robin Scheduling with $n$ processes in ready queue and time quantum $q$, each process gets $1/n$ of CPU time in chunks of at most $q$

I was going through the Round-Robbin Scheduling Section of the dinosaur book by Galvin et. al. where I came across the following statement by the authors:

If there are $n$ processes in the ready queue and the time quantum is $q$, then each process gets $1/n$ of the CPU time in chunks of at most $q$ time units.

For example, with five processes and a time quantum of 20 milliseconds, each process will get up to 20 milliseconds every 100 milliseconds.

The meaning of the statement is not quite clear to me. I tried to make a rough justification of the same, but it did not quite satisfy me. Here is how I did it.

First I assume that all the processes have comparable CPU bursts. Or else the example which the authors give of each process getting up to 20 ms shall not be valid. [ Counterexample, suppose, we have $P_1,P_2,P_3,P_4$ with CPU bursts of $5$ ms each. And the CPU burst of $P_5$ is 80 ms, then if $P_1, P_2, P_3, P_4, P_5$ arrive in order, with in the first $20$ ms the first $4$ processes shall be completed, and then the ready queue shall be having only process $P_5$ and it shall get a total of $80$ ms out $100$ ms.]

Let $T$ be the CPU time and there being $n$ processes in the system with comparable CPU bursts we can assume that,

$$text{Time for each process}approx frac{T}{n}$$

But in Round-Robbin scheduling, each process in its turn runs for at most $q$ time units. [ The process in its last turn might take less than $q$ time units if incase the $q$ does not divide the CPU burst of the process equally]

So this approximate quantity $frac{T}{n}$ is made up of chunks of size at most $q$.

Is this approach appropriate?

[GET] Udemy – [NEW][UDEMY][TODAY >> 15/05/2021][COUPON] 100% FREE FOR LIMITED TIME | Proxies-free

2021 Python Programming From A-Z: Beginner To Expert Course

https://bit.ly/3oiBFWZ

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

HTML & CSS – Certification Course for Beginners

https://bit.ly/33KQ7xp

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Python for beginners – Learn all the basics of python

https://bit.ly/33LhnvR

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Learn Python From ZERO TO HERO [ NOT UDEMY COUPON ]

https://bit.ly/3eU8czL

 

complexity theory – Make Change in Linear Time

The question is motivated by this post on StackOverflow.

Given an integer n and a finite list of distinct positive integers ds, let f(n, ds) denote the number of ways n can be expressed as a sum of elements of ds up to order. Sometimes f(n, ds) is referred to as the number of ways to make change of n in terms of coins with denominations ds. For example:

f(1, (1)) = 1
f(2, (1, 2)) = 2
f(100, (1, 2)) = 51
f(5, (1, 2, 5)) = 4
f(27, (1, 5, 10)) = 12
f(7, (3, 5)) = 0

Question: is it possible to compute f(n, ds) in O(length(ds)) time if integer operations take constant time, e.g. a mod b = O(1)?

Should I have a cooldown time between audio notifications for a group chat? If so, how long?

Taking as a base a research study from Nielsen: 10 Usability Heuristics for User Interface Design

https://www.nngroup.com/articles/ten-usability-heuristics/

Take 2 principles in consideration:

#1: Visibility of system status

“The design should always keep users informed about what is going on, through appropriate feedback within a reasonable amount of time.”

#4: Consistency and standards

“Users should not have to wonder whether different words, situations, or actions mean the same thing. Follow platform and industry conventions.”

What this means is that as we change the dynamics and flows we force the user to learn new things making our application harder to use and understand, more if we take the decision in their place.

That being said I wouldn’t take the approach to not add the sound to the notifications, but rather enable a function to silence them as many messenger do; for an hour, a week, forever…, if you really want to keep them add a configuration setting where the user can change the alert message from sound to visual after x consecutive messages but let the user take that decision and action. You can also suggest it after x consecutive received notifications.

8 – How do I compare a date field with the current time in a twig template?

I have a date field on a node – set to a custom date format (c which is ISO) in the Manage Display.
I have a twig template checking to see if that date field comes before today, in which is should output Past.
Outputting the fields/comparison values gets me the properly formatted dates I want to compare.

{{ content.field_closing_date.0 }}
{{ 'now'|date('c') }}

which outputs

2021-05-05T16:30:00-07:00
2021-05-14T12:01:53-07:00

My comparison is

{% if 'now'|date('c') > content.field_closing_date.0 %}
Past
{% endif %}

But it’s not outputting Past. What gives?
You can see that the todays date does come after the date field.

Time Machine fails since enabling FileVault on iMac with Fusion Drive

I have an iMac with a Fusion Drive, and Time Machine configured to back up to an external USB disk.

Everything used to work well, but then I enabled FileVault for the internal Fusion Drive. Since then, Time Machine has not been able to back up:

enter image description here

Clicking the red info button shows:

enter image description here

I left it for multiple days, rebooted the computer, reset NVRAM, did First Aid using Disk Utility for both the external disk and the filesystem in it, all to no avail. This is on macOS Big Sur 11.3.1 (20E241).

diskutil cs list shows that the encryption is complete.

kartick@iMac ~ % diskutil cs list
CoreStorage logical volume groups (1 found)
|
+-- Logical Volume Group B2E1C2E9-637C-4BAB-897B-ABA771347B48
    =========================================================
    Name:         Time Machine Backup
    Status:       Online
    Size:         5000637104128 B (5.0 TB)
    Free Space:   0 B (0 B)
    |
    +-< Physical Volume 91CE72E6-ACB1-4B90-8DA2-FFE4365D4A4F
    |   ----------------------------------------------------
    |   Index:    0
    |   Disk:     disk3s2
    |   Status:   Online
    |   Size:     5000637104128 B (5.0 TB)
    |
    +-> Logical Volume Family 957C53B4-DB6F-4E1F-B743-286CAA1E75A6
        ----------------------------------------------------------
        Encryption Type:         AES-XTS
        Encryption Status:       Unlocked
        Conversion Status:       Complete
        High Level Queries:      Fully Secure
        |                        Passphrase Required
        |                        Accepts New Users
        |                        Has Visible Users
        |                        Has Volume Key
        |
        +-> Logical Volume 0A5A21A4-D46E-4FE8-9663-3AA7EE5EA68E
            ---------------------------------------------------
            Disk:                  disk4
            Status:                Online
            Size (Total):          5000284778496 B (5.0 TB)
            Revertible:            No
            LV Name:               Time Machine Backup
            Volume Name:           Time Machine Backup
            Content Hint:          Apple_HFS

How do I get it to work?

algorithms – Measuring the length of a “loop” in a linked list in $O(n)$ Time?

I have been given a linked list in Python. At some point, one of the nodes is linked to a previous node creating a “tail” and a “loop”:

Node1 -> Node2 -> Node3 -> Node4 -> Node5 -> Node6 -> Node3

Node1 and Node2 are considered elements of the “tail”, while Node3, 4, 5 and 6 are considered elements of the “loop”.
My task is to measure the length/number of elements in the “loop”.

My approach was to go through the linked list and catch, when a node points towards a node, I have already passed.

However, to check if a node has been already passed, I have chosen to store all passed nodes into a list/array.
Whenever I approach the next node, I check, whether the next node is already stored in the list/array.

This approach does work, however I was hinted, that there is a way to solve this in linear complexity.

If the linked list consists of n nodes
I am adding 1 element to a list with each node
and I am also checking every element in this list with each node

I assume the complexity is something like : $frac{n^2 + n}{2}$ which is clearly not ideal.

However I struggle to find a way to check whether I have already passed a node, without checking all previous nodes with every step. Which again would make it necessary to

  1. Keep a list of all previous nodes and
  2. Loop over this list in each step

which then again would increase the complexity.

Is there a way to check, whether I have already passed a node, without checking on all previous nodes?

[GET] Udemy – [NEW][UDEMY][TODAY >> 14/05/2021][COUPON] 100% FREE FOR LIMITED TIME | Proxies-free

Marketing Analytics: Forecasting Models with Excel

https://bit.ly/33FIcl2

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Beginner’s Guide To Creating Basic Logos With Free Software

https://bit.ly/3flBnug

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Python Bootcamp 2021 Build 15 working Applications and Games

https://bit.ly/3eJFgdq

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Machine Learning & Deep Learning in Python & R | LIMITED TIME

https://bit.ly/33JJjAm

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Beginner’s guide to Competitive programming using python | LIMITED TIME

https://bit.ly/2SGNPNw

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Practical MongoDB + PHP: For Absolute Beginners | LIMITED TIME

https://bit.ly/3ybkzPh