Limit notebook size

We want to limit the notebook size to 8MB. We are able to override pre_save_hook. How to get the notebook size from model object such that it matches if the notebook file is saved?