Maximum Custom Variables Limit

Hello,

I have started using Piwik for a project and I seem to have reached a ceiling on the number of custom variables. Does anyone know if there is a workaround?

If I follow the instructions to increase the number of variables (I first tried 100) the increase command appears to run without error. I then get a failure posting web hits via the API. (Apache error log).

I reduced the number of custom variables to 50 and it works ok.

Looking at the web logs I think the system is getting stuck around the 52 mark.
I notice behind the scenes a new column is added to the piwik_log_visit table for each custom variable configured.
eg…custom_var_v23,custom_var_v24,custom_var_v25…

My initial thoughts are that I am hitting a limit on the number of columns in the mysql table.

Does anyone have any experience, thoughts on this?

I’m using the latest piwik VM from bitnami.
Many Thanks

Hi there,

I thought it should work fine with 100 custom variables but we didn’t test this many.

do you find some errors in your server error log or mysql error log maybe?

according to mysql There is a hard limit of 4096 columns per table MySQL :: MySQL 5.5 Reference Manual :: C.10.4 Limits on Table Column Count and Row Size

Thanks for your reply Matt

I got a bit further with this so thought I would post an update.

I couldn’t find much in the immediate log files but I looked through the PHP and tried the queries on the database manually.

You were correct when you mentioed the data limits. However there is a limit of the number of bytes per row that can be allocated. It seems that the row limit is hit at around 55 variables. If you run the customvariables:set-max-custom-variables 100
command you can see the index doesn’t go up in the output after about 55.

Running the alter table create column SQL manually produces this error.
Error Code: 1118. Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs

https://dev.mysql.com/doc/refman/5.0/en/column-count-limit.html

As advised in the docs above I’ll try updating the column type to TEXT manually and see how I get on.

Many Thanks

Hi there,

Can you let know whether conversion to TEXT worked?
Also did you notice any considerable performance issue due to conversion from VARCHAR to TEXT?

Many Thanks