james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: Packet is larger than max_allowed_packet from server configurationof 1048576 bytes
Date Thu, 09 May 2002 14:11:20 GMT
> its not the driver, its actually the default MySQL configuration (in
> /etc/my.cnf)

It is both.  There are limiting bugs in the version of the mmmysql driver
bundled with James (e.g., "Fixed ArrayIndexOutOfBounds when sending large
BLOB queries -- Max size packet was not being set"), and depending upon your
mysql build, it is likely that you also need to add:

	set-variable = max_allowed_packet=16M

to the [mysqld] section of the global configuration file, e.g., /etc/my.cnf,
or change the startup statement for mysqld to set max_allowed_packet.

For those who care, the documentation for max_allowed_packet says: "This
value by default is small, to catch big (possibly wrong) packets.  You must
increase this value if you are using big BLOB columns. It should be as big
as the biggest BLOB you want to use. The protocol limits for
max_allowed_packet is 16M in MySQL 3.23 and 4G in MySQL 4.0."

If you expect a LOT of large packets, you might want to be aware of the
following: "For example, if you have BLOB values that contain up to 16M of
data, you must have a communication buffer limit of at least 16M (in both
server and client).  The client's default maximum is 16M, but the default
maximum in the server is 1M. You can increase this by changing the value of
the max_allowed_packet parameter when the server is started. The MySQL
server shrinks each communication buffer to net_buffer_length bytes after
each query. For clients, the size of the buffer associated with a connection
is not decreased until the connection is closed, at which time client memory
is reclaimed."

Caveat: "You can also get strange problems with large packets if you are
using big blobs, but you haven't given mysqld access to enough memory to
handle the query. If you suspect this is the case, try adding ulimit -d
256000 to the beginning of the safe_mysqld script and restart mysqld."

	--- Noel

To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>

View raw message