avisi-cloud/structurizr-site-generatr

Need to set PlantUML Size Limit

Closed this issue · 2 comments

qtzar commented

Our enterprise environment is massive, over 500 software Systems with about 200 entered in to our Structurizr DSL. I just started running in to a small issue with a couple of our 'big' diagrams where PlantUML breaks down due to the size of the resulting diagram.

Doing some research it seems I have hit a PlantUML limit where diagrams cannot be wider than 4096px, however there is a setting that you can use to increase this limit.

From the PlantUML FAQ :

PlantUML limits image width and height to 4096. There is a environment variable that you can set to override this limit: PLANTUML_LIMIT_SIZE. You have to define this variable before launching PlantUML, something like:
set PLANTUML_LIMIT_SIZE=8192 or setenv PLANTUML_LIMIT_SIZE 8192
Another way is an option in the command line:
java -DPLANTUML_LIMIT_SIZE=8192 -jar /path/to/plantuml.jar ...
Note that if you generate very big diagrams, (for example, something like 20 000 x 10 000 pixels), you can have some memory issues. The solution is to add this parameter to the java vm : -Xmx1024m.

Wondering how I can get this variable set from within the site generator, maybe an a param in the DSL. Any hints would be helpful and I'll build out a PR to add it to the system.

If this can be configured using an environment variable, I would prefer not adding any code to the system for this. In that case you can just make sure that the environment variable is set before launching the site generator.

qtzar commented

Was able to set the env variable using '-e PLANTUML_LIMIT_SIZE=8192' on the docker command.