Skip to content

Commit

Permalink
Merge pull request #64 from huangyoukun/master
Browse files Browse the repository at this point in the history
chore(config): default-cpuLimit
  • Loading branch information
timcui authored May 28, 2018
2 parents c9692c8 + 3609f5c commit 935a978
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 935a978

Please sign in to comment.