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 , the hydraulic drive unit including: a first hydraulic pump (P1) that discharges a hydraulic oil for activating the plurality of activation hydraulic actuators ; a first electric motor (M1) that drives the first hydraulic pump (P1); a hydraulic pump for revolution (P2) that discharges a hydraulic oil for activating the revolution hydraulic actuator; a second electric motor (M2) that drives the hydraulic pump for revolution (P2); and a motor controller that controls the rotation of the first electric motor (M1) and that of the second electric motor (M2), 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 (M2), characterized in that when at least one of the plurality of activation hydraulic actuators and the revolution hydraulic actuator are activated together, the motor controller controls the rotation of the first electric motor (M1), thereby controlling the discharge flow rate of the first hydraulic pump (P1) in such a manner that the discharge flow rate of the first hydraulic pump (P1) is reduced by the discharge flow rate of the hydraulic pump for revolution (P2). 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 , the hydraulic drive unit including: a first hydraulic pump (P1) that discharges a hydraulic oil for activating the plurality of activation hydraulic actuators ; a first electric motor (M1) that drives the first hydraulic pump (P1); a hydraulic pump for revolution (P2) that discharges a hydraulic oil for activating the revolution hydraulic actuator; a second electric motor (M2) that drives the hydraulic pump for revolution (P2); and a motor controller that controls the rotation of the first electric motor (M1) and that of the second electric motor (M2), 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 (M2), characterized in that when at least one of the plurality of activation hydraulic actuators and the revolution hydraulic actuator are activated together, the motor controller controls the rotation of the first electric motor (M1), thereby controlling the discharge flow rate of the first hydraulic pump (P1) in such a manner that the discharge flow rate of the first hydraulic pump (P1) is reduced by the discharge flow rate of the hydraulic pump for revolution (P2). a first hydraulic pump (P1) that discharges a hydraulic oil for activating the plurality of activation hydraulic actuators ; a first electric motor (M1) that drives the first hydraulic pump (P1); a hydraulic pump for revolution (P2) that discharges a hydraulic oil for activating the revolution hydraulic actuator; a second electric motor (M2) that drives the hydraulic pump for revolution (P2); and a motor controller that controls the rotation of the first electric motor (M1) and that of the second electric motor (M2), 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 (M2), <EOS>