Greg Stark <[EMAIL PROTECTED]> writes: > The only problem I see in raising the size of PGSTAT_MSG_PAYLOAD is that it > also governs the size of PGSTAT_NUM_TABPURGE and PGSTAT_NUM_TABENTRIES. > There's no need to grow those arrays and risk losing them. But these message > sizes could just be left based on the 1k value while boosting the maximum size > of PGSTAT_ACTIVITY_SIZE.
Just to be clear, I'm talking about something as simple as this: (Haven't finished compiling it yet) --- pgstat.h.~1.26.~ 2004-08-29 00:13:03.000000000 -0400 +++ pgstat.h 2004-11-08 17:17:17.000000000 -0500 @@ -57,12 +57,13 @@ } PgStat_MsgHdr; /* ---------- - * Space available in a message. This will keep the UDP packets below 1K, - * which should fit unfragmented into the MTU of the lo interface on most - * platforms. Does anybody care for platforms where it doesn't? + * Space used by a message ideally and maximum space used. We try to not to go + * over 1k unless necessary to avoid UDP packets that don't fit into the MTU + * of the loopback interface on very old systems and need to be fragmented. * ---------- */ -#define PGSTAT_MSG_PAYLOAD (1000 - sizeof(PgStat_MsgHdr)) +#define PGSTAT_MSG_PAYLOAD_IDEAL (1000 - sizeof(PgStat_MsgHdr)) +#define PGSTAT_MSG_PAYLOAD (32740 - sizeof(PgStat_MsgHdr)) /* ---------- * PgStat_TableEntry Per-table info in a MsgTabstat @@ -131,7 +132,7 @@ * and buffer access statistics. * ---------- */ -#define PGSTAT_NUM_TABENTRIES ((PGSTAT_MSG_PAYLOAD - 3 * sizeof(int)) \ +#define PGSTAT_NUM_TABENTRIES ((PGSTAT_MSG_PAYLOAD_IDEAL - 3 * sizeof(int)) \ / sizeof(PgStat_TableEntry)) typedef struct PgStat_MsgTabstat @@ -148,7 +149,7 @@ * about dead tables. * ---------- */ -#define PGSTAT_NUM_TABPURGE ((PGSTAT_MSG_PAYLOAD - sizeof(int)) \ +#define PGSTAT_NUM_TABPURGE ((PGSTAT_MSG_PAYLOAD_IDEAL - sizeof(int)) \ / sizeof(Oid)) typedef struct PgStat_MsgTabpurge -- greg ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend