我使用wrk
来测试由ubuntu 16.04
上的主管管理的Web API服务。有错误“太多打开文件”,但我已设置系统配置
/etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
仍有错误“打开文件过多”
我发现supervisord属于root
和cat /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
答案 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