A hydraulic drive unit of a hydraulic excavator, for use in a hydraulic excavator comprising: a traveling body capable of traveling; a revolving body provided on the traveling body in a horizontally revolvable manner and horizontally revolved by a revolution hydraulic actuator; and an excavator device provided to the revolving body and driven by a plurality of activation hydraulic actuators (36, 37, 38), the hydraulic drive unit including: a first hydraulic pump that discharges a hydraulic oil for activating the plurality of activation hydraulic actuators (36, 37, 38); a first electric motor that drives the first hydraulic pump; a hydraulic pump for revolution that discharges a hydraulic oil for activating the revolution hydraulic actuator; a second electric motor that drives the hydraulic pump for revolution; and a motor controller that controls the rotation of the first electric motor and that of the second electric motor, wherein when the revolution of the revolving body is not activated by the revolution hydraulic actuator, the motor controller performs control to deactivate the second electric motor, characterized in that when at least one of the plurality of activation hydraulic actuators (36, 37, 38) and the revolution hydraulic actuator are activated together, the motor controller controls the rotation of the first electric motor, thereby controlling the discharge flow rate of the first hydraulic pump in such a manner that the discharge flow rate of the first hydraulic pump is reduced by the discharge flow rate of the hydraulic pump for revolution. a traveling body capable of traveling; a revolving body provided on the traveling body in a horizontally revolvable manner and horizontally revolved by a revolution hydraulic actuator; and an excavator device provided to the revolving body and driven by a plurality of activation hydraulic actuators (36, 37, 38), the hydraulic drive unit including: a first hydraulic pump that discharges a hydraulic oil for activating the plurality of activation hydraulic actuators (36, 37, 38); a first electric motor that drives the first hydraulic pump; a hydraulic pump for revolution that discharges a hydraulic oil for activating the revolution hydraulic actuator; a second electric motor that drives the hydraulic pump for revolution; and a motor controller that controls the rotation of the first electric motor and that of the second electric motor, wherein when the revolution of the revolving body is not activated by the revolution hydraulic actuator, the motor controller performs control to deactivate the second electric motor, characterized in that when at least one of the plurality of activation hydraulic actuators (36, 37, 38) and the revolution hydraulic actuator are activated together, the motor controller controls the rotation of the first electric motor, thereby controlling the discharge flow rate of the first hydraulic pump in such a manner that the discharge flow rate of the first hydraulic pump is reduced by the discharge flow rate of the hydraulic pump for revolution. a first hydraulic pump that discharges a hydraulic oil for activating the plurality of activation hydraulic actuators (36, 37, 38); a first electric motor that drives the first hydraulic pump; a hydraulic pump for revolution that discharges a hydraulic oil for activating the revolution hydraulic actuator; a second electric motor that drives the hydraulic pump for revolution; and a motor controller that controls the rotation of the first electric motor and that of the second electric motor, wherein when the revolution of the revolving body is not activated by the revolution hydraulic actuator, the motor controller performs control to deactivate the second electric motor,