Hyperglycemia associated with insulin resistance is common in surgical patients with and without diabetes and is associated with poor surgical outcomes. Several studies have recently shown that a closed-loop blood glucose monitoring system in the form of an artificial pancreas is safe and effective for surgical patients. In this study, we analyzed the risk factors for insulin resistance in patients using an artificial pancreas. We investigated 109 patients who underwent surgical management by an artificial pancreas for 24 hours from the start of surgery during either major hepatectomy (MH), defined as resection of more than two liver segments, or pancreaticoduodenectomy (PD). The target glucose range was 80 to 110 mg/dL using an artificial pancreas. We analyzed the risk factors for and predictors of a high insulin dose, including sarcopenia markers, according to the median 24-hour total insulin infusion. The median total insulin dose and glycemic control rate which is the rate of achieving the target blood glucose range per 24 hours were 78.0 IU and 30.4% in the MH group and 82.6 IU and 23.5% in the pancreaticoduodenectomy group, respectively. The muscle volume was the only independent factor in the high-dose subgroup, and the glycemic control rate was significantly lower in the high-dose subgroup despite a high insulin dose in both the major hepatectomy and pancreaticoduodenectomy groups. The results of this study suggest that preoperative sarcopenia is closely associated with insulin resistance in the perioperative period. Clinicians must effectively manage sarcopenia, which may result in improved perioperative glycemic control and reduced postoperative complications.