config for max history length

fix #177