supervisord提出的打开文件太多了?

时间:2017-07-12 10:57:18

标签: linux supervisord

我使用wrk来测试由ubuntu 16.04上的主管管理的Web API服务。有错误“太多打开文件”,但我已设置系统配置

/etc/security/limits.conf
*           soft    nofile  65535
*           hard    nofile  65535

仍有错误“打开文件过多”

我发现supervisord属于rootcat /proc/PID/limits

Max open files            1024                 4096                 files

所以,将根限制设置添加到limits.conf,如下所示

root        soft    nofile  65535
root        hard    nofile  65535

重新启动后监督它受影响(猫/proc/PID/limits,得到65535) 但是supervisord很快退出,并自动启动限制1024。

Jul 12 18:55:53 adhost supervisord[10866]: Error: Another program is already listening on a port that one of our HTTP servers is configured to use.  Shut this program down first before starting supervisord.
Jul 12 18:55:53 adhost supervisord[10866]: For help, use /usr/bin/supervisord -h
Jul 12 18:55:53 adhost systemd[1]: supervisor.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 12 18:55:53 adhost supervisorctl[10871]: Shut down

参考:ubuntu - too many open files?

1 个答案:

答案 0 :(得分:0)

AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Context); View alertView = AddExpenses.this.getLayoutInflater().inflate(R.layout.layout_alert_expenses, null); int amount = Integer.parseInt(etExpensesAmount.getText().toString()); final ListView lvAlertDialogue = (ListView) alertView.findViewById(R.id.lv_alert_expenses); final TextView tvTotal = (TextView) alertView.findViewById(R.id.tv_amount); tvTotal.setText(etExpensesAmount.getText().toString()); CustomAdapterAlertList customAdapterAlertList = new CustomAdapterAlertList(AddExpenses.this, listSelectedContact, amount); lvAlertDialogue.setAdapter(customAdapterAlertList); alertDialogBuilder.setView(alertView); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { View singleView = lvAlertDialogue.getChildAt(listSelectedContact.size() - 1); //singleView is null here } }); alertDialog.show(); 解决了我应该直接杀死P