I tried to store an array containing about 50000 keys and respective values to the user meta using update_user_meta. Since, this was only a test, I ran a for loop to generate the array.
$test = array ();
for ($i = 0; $i <= 50000; $i++) {
$test[$i] = $i;
}
update_user_meta($user_id, 'test', $test);
I ended up getting the error WordPress database error: [MySQL server has gone away]
. Eventually, I was able to get it working with an array size of 48000 keys. Since update_user_meta converts arrays to serialized data before storing, is there a limit to the serialized data that user meta or post metas can handle? Or does this happen due to some other issue?
I tried the timeout fix suggested here. But I am not sure if it is supposed to work for WP 3.3.1. or whether if at all it is solution to my problem.
Please note I am using a local dev install using MAMP.