Re: Increasing the length of pg_stat_activity.current_query... - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Increasing the length of pg_stat_activity.current_query...
Date
Msg-id 873bzkj7n1.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Increasing the length of pg_stat_activity.current_query...  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark <gsstark@MIT.EDU> 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-tableinfo 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))typedefstruct PgStat_MsgTabpurge
 

-- 
greg



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Increasing the length of pg_stat_activity.current_query...
Next
From: Tom Lane
Date:
Subject: Re: Increasing the length of pg_stat_activity.current_query...