Skip to content

Commit

Permalink
chore(config): default-cpuLimit
Browse files Browse the repository at this point in the history
更新默认值策略
  • Loading branch information
huangyoukun committed May 28, 2018
1 parent c9692c8 commit 3609f5c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bin/lib/default/config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';
const os = require('os');
const mpc = Math.round(os.totalmem() / os.cpus().length / 1024 / 1024 / 1024);


this.defaultConfigLoadFrom = __filename;
Expand Down Expand Up @@ -72,14 +74,14 @@ this.workerUid = 'nobody';

// mod_act映射
this.modAct = {
getModAct: function(req) {
getModAct: function (req) {
return null;
}
};

// 路由
this.modMap = {
find: function(mod_act, req, res) {
find: function (mod_act, req, res) {
return null;
}
};
Expand All @@ -99,7 +101,7 @@ this.logger = {
this.cpuLimit = 85;

// 内存限制
this.memoryLimit = 768 * 1024 * 1024;
this.memoryLimit = 768 * 1024 * 1024 * (mpc >= 2 ? 2 : 1);

// 限制
this.CCIPLimit = 500;
Expand All @@ -122,7 +124,8 @@ this.timeout = {


this.extendMod = {
getUin: req => {}
getUin: req => {
}
};

// openapi
Expand Down

0 comments on commit 3609f5c

Please sign in to comment.