pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pietro Pugni <pietro.pugni@gmail.com>
To: Mkrtchyan, Tigran <tigran.mkrtchyan@desy.de>
Cc: ik@postgresql-consulting.com, pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: Can't get Dell PE T420 (Perc H710) perform better than a MacMini with PostgreSQL
Date: Thu, 2 Apr 2015 16:25:03 +0200
Message-ID: <C33FBFAF-D442-44FA-B76A-6F525BD5851B@gmail.com> (raw)
In-Reply-To: <1095510641.1517209.1427977377666.JavaMail.zimbra@desy.de>
References: <732B95A3-FEC8-4623-9AC5-98FD30F00863@gmail.com>
	<CAG95seWrfjHFwQEtn=0D-k0ex+Ag7cbOuFuaz4jgMhC9NJxp=A@mail.gmail.com>
	<9A77A65B-061D-4712-A21D-83B02DF18C57@gmail.com>
	<1095510641.1517209.1427977377666.JavaMail.zimbra@desy.de>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Hi Tigran,

> The modern CPUs trying to be too smart.
> 
> try to run this code to disable CPUs c-states:
> 
> ----> setcpulatency.c 
> 
> #include <stdio.h>
> #include <fcntl.h>
> #include <stdint.h>
> 
> int main(int argc, char **argv) {
>   int32_t l;
>   int fd;
> 
>   if (argc != 2) {
>      fprintf(stderr, "Usage: %s <latency in us>\n", argv[0]);
>      return 2;
>   }
> 
>   l = atoi(argv[1]);
>   printf("setting latency to %d us\n", l);
>   fd = open("/dev/cpu_dma_latency", O_WRONLY);
>   if (fd < 0) {
>      perror("open /dev/cpu_dma_latency");
>      return 1;
>   }
> 
>   if (write(fd, &l, sizeof(l)) != sizeof(l)) {
>      perror("write to /dev/cpu_dma_latency");
>      return 1;
>   }
> 
>   while (1) pause();
> }
> 
> 
> ——>
> 
your C code should be equivalent to the following:
echo 0 > /dev/cpu_dma_latency
Right?
I executed the above command but time execution increase of about 2 seconds over 129seconds (I’ve executed the transaction several times repeating the procedure of restarting db and redoing transaction). With setting echo 1 > /dev/cpu_dma_latency it returns to 129seconds.

> you can use i7z (https://code.google.com/p/i7z/) to see the percentage of CPU power to be used.

I’ve installed i7z-GUI but it reports the following and crashes with segmentation fault (T420 has Intel Xeon, not i-series):
i7z DEBUG: i7z version: svn-r77-(20-Nov-2011)
i7z DEBUG: Found Intel Processor
i7z DEBUG:    Stepping 4
i7z DEBUG:    Model e
i7z DEBUG:    Family 6
i7z DEBUG:    Processor Type 0
i7z DEBUG:    Extended Model 3
i7z DEBUG: msr = Model Specific Register
i7z DEBUG: detected a newer model of ivy bridge processor
i7z DEBUG: my coder doesn't know about it, can you send the following info to him?
i7z DEBUG: model e, extended model 3, proc_family 6
i7z DEBUG: msr device files DONOT exist, trying out a makedev script
i7z DEBUG: modprobbing for msr
[1]+  Segmentation fault      (core dumped) i7z_GUI


> Changing CPU from C1 to C0 takes quite some time and for DB workload not optimal (if you need a 
> high throughout and any given moment).
> 
> I see ~65% boost when run './setcpulatency 0'.
> 
> Tigran.
> 
With “takes quite some time” you mean that it will take some time to take effect?

Thank you a lot for your help.
Best regards,
 Pietro

view thread (28+ messages)  latest in thread

Message-ID: <C33FBFAF-D442-44FA-B76A-6F525BD5851B@gmail.com>
Permalink:  ../C33FBFAF-D442-44FA-B76A-6F525BD5851B@gmail.com/
Also on:    postgresql.org/message-id/C33FBFAF-D442-44FA-B76A-6F525BD5851B@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pietro.pugni@gmail.com, tigran.mkrtchyan@desy.de
  Subject: Re: Can't get Dell PE T420 (Perc H710) perform better than a MacMini with PostgreSQL
  In-Reply-To: <C33FBFAF-D442-44FA-B76A-6F525BD5851B@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox