When, upon an action brought on any recognizance, the penalty thereof is adjudged forfeited, the court may remit a portion of the penalty, on the petition of the defendant, as is just and reasonable.